コード例 #1
0
        static void Main(string[] args)
        {
            BinaryTree theTree = new BinaryTree();

            theTree.Insert(23);
            theTree.Insert(43);
            theTree.Insert(12);
            theTree.Insert(54);
            theTree.Insert(22);
            theTree.Insert(76);
            theTree.Insert(54);
            theTree.Insert(34);
            Console.WriteLine("Inorder Traversal : ");
            theTree.InorderTransveral(theTree.ReturnRoot());
            Console.WriteLine(" ");

            //Checks each node of the tree and outputs if node is present or not
            //using Search()
            Console.WriteLine(" ");
            theTree.Search(theTree.root, 2);
            Console.ReadKey();
        }