Example #1
0
            static void Main(string[] args)
            {
                DepthFirstAlgorithm b    = new DepthFirstAlgorithm();
                Employee            root = b.BuildEmployeeGraph();

                Console.WriteLine("Traverse Graph\n------");
                b.TraverseDFS(root);

                Console.WriteLine("\nSearch in Graph\n------");
                Employee e = b.SearchDFS(root, "Eva");

                Console.WriteLine(e == null ? "Employee not found" : e.name);
                e = b.SearchDFS(root, "Brian");
                Console.WriteLine(e == null ? "Employee not found" : e.name);
                e = b.SearchDFS(root, "Soni");
                Console.WriteLine(e == null ? "Employee not found" : e.name);
            }