This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For YouTube video: | |
// https://youtu.be/UnPZHwVCQdo | |
public IEnumerable<T> Flatten(T parent) | |
where T : IParent | |
{ | |
yield return parent; | |
foreach (T child in parent.Children) | |
{ | |
foreach (T grand in Flatten(child)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
namespace DictionaryTest | |
{ | |
class Program | |
{ | |
/* CPU: AMD Ryzen Threadripper 1950x @ 4.0 Ghz | |
* Count: 100000000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
/* https://github.com/miyconst/Cyriller */ | |
namespace CyrillerTest | |
{ | |
class Program |