Beispiel #1
0
        static void Main(string[] args)
        {
            Graph g = new Graph(4);

            g.AddEdge(0, 1);
            g.AddEdge(1, 3);
            g.AddEdge(1, 2);
            g.AddEdge(0, 2);
            Console.WriteLine("Doing DFS");
            g.Dfs(0);
            g.ClearVisited();
            Console.WriteLine("Doing BFS");
            g.Bfs(0);
        }