Exemple #1
0
            public List <Node> TopologicalSort()
            {
                explored = new Stack <Node>();
                visited  = new HashSet <Node>();

                foreach (var node in nodes)
                {
                    Explore(node);
                }

                return(explored.ToList());
            }
Exemple #2
0
        private static List <int> FillBits(byte byt)
        {
            var result = new List <int>();
            var bits   = new Stack <int>();

            for (var index = 0; index < 8; index++)
            {
                bits.Push(byt % 2);
                byt /= 2;
            }

            return(bits.ToList());
        }