Ejemplo n.º 1
0
        public void DepthFirst_TestsBuildGraphOnly()
        {
            int capacity = 2;

            for (int i = 0; i < 12; i++)
            {
                var map     = BuildDependencies(capacity, 50);
                var start   = DateTime.Now;
                var sorted  = TopologicalSort.DepthFirstSort(map);
                var totalMS = DateTime.Now.Subtract(start).TotalMilliseconds;

                Console.WriteLine($"{totalMS}ms to sort {capacity} objects using DFS.");
                capacity *= 2;
            }
        }