Esempio n. 1
0
        private DepthFirstSearch CreateDFS()
        {
            Graph graph = new Graph(8);

            graph.AddEdge(0, 2);
            graph.AddEdge(2, 1);
            graph.AddEdge(2, 3);
            graph.AddEdge(3, 4);
            graph.AddEdge(3, 5);
            graph.AddEdge(6, 7);

            return(DepthFirstSearch.Create(graph, 5));
        }