Beispiel #1
0
        public static void SearchBstTest()
        {
            var tree = BSTUtilities.CreateRandomBST();
            var test = BSTUtilities.Search(tree._root, 99);

            Console.WriteLine(test?.data ?? -1);
            test = BSTUtilities.Search(tree._root, 70);
            Console.WriteLine(test?.data);
        }
Beispiel #2
0
        public static void DeleteKeyFromBstTest()
        {
            var tree = BSTUtilities.CreateRandomBST();
            var test = BSTUtilities.Search(tree._root, 70);

            tree.InOrderTraversal();
            Console.WriteLine();
            var t = BSTUtilities.Delete(tree._root, 70);
            //Console.WriteLine(BSTUtilities.GetMinimumValue(tree._root.right));
        }
Beispiel #3
0
        public static void InOrderBSTTraversalTest()
        {
            var tree = BSTUtilities.CreateRandomBST();

            tree.InOrderTraversal();
        }