示例#1
0
        static void Main(string[] args)
        {
            BinaryTree bt = new BinaryTree(); //Create a Binary Tree

            bt.Root             = new Node(1);
            bt.Root.Left        = new Node(2);
            bt.Root.Right       = new Node(3);
            bt.Root.Left.Left   = new Node(4);
            bt.Root.Left.Right  = new Node(5);
            bt.Root.Right.Left  = new Node(6);
            bt.Root.Right.Right = new Node(7);

            Console.WriteLine("Zigjag BFS traversal of  binary tree  is ");
            bt.PrintBFSOrder(bt.Root); //Print BFS Mode and reverse at each level while printing
            Console.ReadKey();
        }