예제 #1
0
        static void TestTree()
        {
            BinarySearchTree <int> tree = new BinarySearchTree <int>(5, null, null);

            tree.Insert(tree.GetRootNode(), -8);
            tree.Insert(tree.GetRootNode(), 10);
            tree.Insert(tree.GetRootNode(), 3);
            tree.Insert(tree.GetRootNode(), 8);
            tree.Insert(tree.GetRootNode(), 9);
            tree.Insert(tree.GetRootNode(), 0);
            Console.WriteLine(tree.FindMin(tree.GetRootNode()).data);
            tree.Print();
            tree.DeleteNode(10);
            tree.Print();
            //Console.WriteLine(tree.Search(tree.GetRootNode(), 9).data);
        }