Summary.txt: Passed: check of BST initialization. Passed: check of BinaryNode initialization. Passed: check of BST insertion. Passed: check of BST isEmpty() function. Passed: check of BST search. Passed: check of BST deletion. Passed: check of BST equals method. Passed: check of BST height method. Passed 8 of 8 tests executed. TestNodeInitialization.txt: checkNodeInitialization results: Creating a new BinaryNode using basic constructor. Node contains correct data value. Node's left child pointer was OK. Node's right child pointer was OK. TestTreeInitialization.txt: checkTreeInitialization results: Creating a new BST using default constructor. BST root was OK. TestInsertion.txt: Begin test of BST insertion. Checking insertion of value to empty tree... Root pointer is not null. Root node contains correct data value. Root node pointers are both null. Checking insertion of two children of the current root node... Insertion did not change root address. Root node has two non-null child pointers. Left child stores correct value. Right child stores correct value. Let's see what the tree looks like now: --- 652 662 --- 672 Try inserting a value, 652, that's already in the tree. insert() returned false. Let's see what the tree looks like now: --- 652 662 --- 672 Beginning general insertion test with a new, empty tree... Filling BST with 125 random integer values. Inserted values: 844 811 -199 986 -990 -20 -574 459 -100 569 -919 91 -67 -86 -910 832 343 435 449 708 -46 -9 290 -642 909 150 802 705 -767 706 34 315 -894 -952 649 737 72 803 -950 658 -850 -739 359 -358 17 -983 997 576 796 -525 -424 91 17 882 704 -904 -957 655 -355 -720 995 47 -488 360 -888 942 -182 -511 819 -756 369 882 882 -634 -768 123 -388 -579 -505 788 261 105 116 -411 -302 516 -991 -832 440 -983 -514 -259 -847 772 41 -131 502 -786 923 817 460 -751 -779 884 -175 -22 -740 14 718 -259 -911 59 986 566 501 -43 189 885 619 142 -877 610 823 809 874 Resulting tree follows. If the log ends suddenly, it's likely a pointer exception occurred. ------------ -991 --------- -990 --------------------- -983 ------------------------ -957 ------------------ -952 --------------------- -950 --------------- -919 --------------------- -911 ------------------ -910 ------------------------------ -904 --------------------------- -894 --------------------------------- -888 ------------------------------------ -877 ------------------------------ -850 --------------------------------------- -847 ------------------------------------ -832 --------------------------------------- -786 ------------------------------------------ -779 --------------------------------- -768 ------------------------ -767 ------------------------------ -756 --------------------------------- -751 ------------------------------------ -740 --------------------------- -739 ------------------------------ -720 --------------------- -642 ------------------------ -634 --------------------------- -579 ------------ -574 ------------------ -525 ------------------------------ -514 --------------------------- -511 ------------------------------ -505 ------------------------ -488 --------------------- -424 --------------------------- -411 ------------------------ -388 --------------- -358 ------------------ -355 --------------------- -302 ------------------------ -259 ------ -199 --------------- -182 --------------------- -175 ------------------ -131 ------------ -100 ------------------ -86 --------------- -67 ------------------ -46 ------------------------ -43 --------------------- -22 --------- -20 ------------------ -9 --------------------------- 14 ------------------------ 17 --------------------- 34 ------------------------------ 41 --------------------------- 47 ------------------------------ 59 ------------------------ 72 --------------- 91 ------------------------------ 105 --------------------------------- 116 --------------------------- 123 ------------------------------ 142 ------------------------ 150 ------------------------------ 189 --------------------------- 261 --------------------- 290 ------------------------ 315 ------------------ 343 ------------------------ 359 --------------------------- 360 ------------------------------ 369 --------------------- 435 --------------------------- 440 ------------------------ 449 ------------ 459 ------------------------ 460 --------------------------- 501 --------------------- 502 ------------------ 516 --------------------- 566 --------------- 569 --------------------------- 576 --------------------------------- 610 ------------------------------ 619 ------------------------ 649 ------------------------------ 655 --------------------------- 658 ------------------------------ 704 --------------------- 705 ------------------------ 706 ------------------ 708 --------------------------- 718 ------------------------ 737 --------------------------------- 772 ------------------------------ 788 --------------------------- 796 --------------------- 802 ------------------------ 803 --------------------------- 809 --- 811 ------------ 817 --------- 819 ------------ 823 ------ 832 844 ------------ 874 --------- 882 ------------ 884 --------------- 885 ------ 909 ------------ 923 --------- 942 --- 986 --------- 995 ------ 997 TestIsEmpty.txt: Begin test of isEmpty() function. Building an empty tree... isEmpty() returned true. Inserting a value into the tree... isEmpty() returned false. TestSearch.txt: Begin test of BST search. Filling BST with 4 random integer values. Inserted values: -455 701 801 -170 Resulting tree follows. If the log ends suddenly, it's likely a pointer exception occurred. -455 ------ -170 --- 701 ------ 801 Search for some random elements that should be present: searching for: -455 Evidently found! Let's see what we got: -455 searching for: -170 Evidently found! Let's see what we got: -170 searching for: 701 Evidently found! Let's see what we got: 701 searching for: 801 Evidently found! Let's see what we got: 801 Searching for some absent elements: searching for: 2522 not there! searching for: 2410 not there! searching for: 2569 not there! TestDeletion.txt: Begin test of BST deletion. Building a one-node tree... Attempting to delete root node.... delete() returned true. Success: tree root deletion with single-node tree passed. Checking deletion with 3-node 2-level tree... Building a 3-node 2-level tree. Let's see what the tree looks like now: --- 645 655 --- 665 Let's try deleting a value, 755, that's not in the tree. delete() returned false. Let's see what the tree looks like now: --- 645 655 --- 665 Attempting to delete left leaf... Success: left child deletion passed. Attempting to delete root... Success: root deletion passed. Checking deletion with full tree of 3 levels... Building the tree. Attempting to delete root... (two subtrees) Success: root deletion passed. Now let's delete the rest of the right subtree... Checking results of deletion. Success: deletion of right subtree passed. And, now delete the current root...(left subtree only) Checking results of deletion. Success: deletion of root with only left subtree passed. Beginning test of general random deletion. Building tree with 50 nodes. Filling BST with 50 random integer values. Inserted values: 850 371 732 176 979 -717 254 -756 -72 547 -31 496 -234 847 241 92 -997 -26 -917 774 450 78 -467 180 126 537 643 -899 -684 -209 276 877 182 -716 325 -767 -954 -67 533 570 737 -963 729 -595 533 -691 274 -197 701 -188 Resulting tree follows. If the log ends suddenly, it's likely a seg fault occurred. --------------- -997 ------------------------ -963 --------------------- -954 ------------------ -917 --------------------- -899 ------------------------ -767 ------------ -756 --------- -717 ------------------------ -716 --------------------------- -691 --------------------- -684 ------------------------ -595 ------------------ -467 --------------- -234 ------------------ -209 --------------------- -197 ------------------------ -188 ------------ -72 ------------------ -67 --------------- -31 --------------------- -26 ------------------------ 78 ------------------ 92 --------------------- 126 ------ 176 --------------- 180 ------------------ 182 ------------ 241 --------- 254 --------------- 274 ------------ 276 --------------- 325 --- 371 --------------- 450 ------------ 496 ------------------ 533 --------------- 537 --------- 547 --------------- 570 ------------ 643 ------------------ 701 --------------- 729 ------ 732 --------------- 737 ------------ 774 --------- 847 850 ------ 877 --- 979 Deleting some random elements... deleting: -997 deleting: -954 deleting: -899 deleting: -756 deleting: -716 deleting: -684 deleting: -467 deleting: -209 deleting: -188 deleting: -67 deleting: -26 deleting: 92 deleting: 176 deleting: 182 deleting: 254 deleting: 276 deleting: 371 deleting: 496 deleting: 537 deleting: 570 deleting: 701 deleting: 732 deleting: 774 deleting: 850 deleting: 979 Display resulting BST to check for structure and ordering: --------------- -963 ------------ -917 --------------- -767 --------- -717 --------------------- -691 ------------------ -595 --------------- -234 ------------------ -197 ------------ -72 --------------- -31 --------------------- 78 ------------------ 126 ------ 180 ------------ 241 --------- 274 ------------ 325 --- 450 ------------ 533 --------- 547 ------------ 643 --------------- 729 ------ 737 --------- 847 877 Delete remaining elements by repeatedly deleting the root: deleting: 877 deleting: 450 deleting: 533 deleting: 547 deleting: 643 deleting: 729 deleting: 737 deleting: 847 deleting: 180 deleting: 241 deleting: 274 deleting: 325 deleting: -717 deleting: -691 deleting: -595 deleting: -234 deleting: -197 deleting: -72 deleting: -31 deleting: 78 deleting: 126 deleting: -917 deleting: -767 deleting: -963 Deletion terminated with correct count. TestEquals.txt: Begin test of BST equals method. Create a new, empty tree... Compare empty tree to null... Equals method says they are not equal. Create a different, empty tree... Compare two empty trees to each other... Equals method says they are equal. Create a non-empty tree... Compare the nonempty tree to an empty one... Equals method says they are not equal. Check commutativity for this case... Equals method says they are not equal. Create a second, equal non-empty tree... Compare the two nonempty trees to each other... Equals method says they are equal. Create a non-equal, non-empty tree... Compare the two nonempty trees to each other... Equals method says they are not equal. Check commutativity for this case... Equals method says they are not equal. TestHeight.txt: Begin test of BST height method. Create a new, empty tree... Empty tree should report height is zero... height reported to be 0. Now add 438 to the tree... One-node tree should report height is one... height reported to be 1. Now add 388 to the tree... Height should now be two... height reported to be 2. Now add 488 to the tree... Height should now be two... height reported to be 2. Beginning general height test... Inserting 401... --- 388 ------ 401 438 --- 488 Reported height: 3 Inserting 876... --- 388 ------ 401 438 --- 488 ------ 876 Reported height: 3 Inserting 613... --- 388 ------ 401 438 --- 488 --------- 613 ------ 876 Reported height: 4 Inserting 341... ------ 341 --- 388 ------ 401 438 --- 488 --------- 613 ------ 876 Reported height: 4 Inserting 625... ------ 341 --- 388 ------ 401 438 --- 488 --------- 613 ------------ 625 ------ 876 Reported height: 5 Inserting 162... --------- 162 ------ 341 --- 388 ------ 401 438 --- 488 --------- 613 ------------ 625 ------ 876 Reported height: 5 Inserting 911... --------- 162 ------ 341 --- 388 ------ 401 438 --- 488 --------- 613 ------------ 625 ------ 876 --------- 911 Reported height: 5 Inserting 708... --------- 162 ------ 341 --- 388 ------ 401 438 --- 488 --------- 613 ------------ 625 --------------- 708 ------ 876 --------- 911 Reported height: 6 Inserting 904... --------- 162 ------ 341 --- 388 ------ 401 438 --- 488 --------- 613 ------------ 625 --------------- 708 ------ 876 ------------ 904 --------- 911 Reported height: 6 Inserting 497... --------- 162 ------ 341 --- 388 ------ 401 438 --- 488 ------------ 497 --------- 613 ------------ 625 --------------- 708 ------ 876 ------------ 904 --------- 911 Reported height: 6 Inserting 579... --------- 162 ------ 341 --- 388 ------ 401 438 --- 488 ------------ 497 --------------- 579 --------- 613 ------------ 625 --------------- 708 ------ 876 ------------ 904 --------- 911 Reported height: 6 Inserting 880... --------- 162 ------ 341 --- 388 ------ 401 438 --- 488 ------------ 497 --------------- 579 --------- 613 ------------ 625 --------------- 708 ------ 876 --------------- 880 ------------ 904 --------- 911 Reported height: 6 Inserting 242... --------- 162 ------------ 242 ------ 341 --- 388 ------ 401 438 --- 488 ------------ 497 --------------- 579 --------- 613 ------------ 625 --------------- 708 ------ 876 --------------- 880 ------------ 904 --------- 911 Reported height: 6 Inserting 308... --------- 162 ------------ 242 --------------- 308 ------ 341 --- 388 ------ 401 438 --- 488 ------------ 497 --------------- 579 --------- 613 ------------ 625 --------------- 708 ------ 876 --------------- 880 ------------ 904 --------- 911 Reported height: 6 Inserting 390... --------- 162 ------------ 242 --------------- 308 ------ 341 --- 388 --------- 390 ------ 401 438 --- 488 ------------ 497 --------------- 579 --------- 613 ------------ 625 --------------- 708 ------ 876 --------------- 880 ------------ 904 --------- 911 Reported height: 6 Inserting 522... --------- 162 ------------ 242 --------------- 308 ------ 341 --- 388 --------- 390 ------ 401 438 --- 488 ------------ 497 ------------------ 522 --------------- 579 --------- 613 ------------ 625 --------------- 708 ------ 876 --------------- 880 ------------ 904 --------- 911 Reported height: 7 Inserting 759... --------- 162 ------------ 242 --------------- 308 ------ 341 --- 388 --------- 390 ------ 401 438 --- 488 ------------ 497 ------------------ 522 --------------- 579 --------- 613 ------------ 625 --------------- 708 ------------------ 759 ------ 876 --------------- 880 ------------ 904 --------- 911 Reported height: 7 Inserting 90... ------------ 90 --------- 162 ------------ 242 --------------- 308 ------ 341 --- 388 --------- 390 ------ 401 438 --- 488 ------------ 497 ------------------ 522 --------------- 579 --------- 613 ------------ 625 --------------- 708 ------------------ 759 ------ 876 --------------- 880 ------------ 904 --------- 911 Reported height: 7 Inserting 847... ------------ 90 --------- 162 ------------ 242 --------------- 308 ------ 341 --- 388 --------- 390 ------ 401 438 --- 488 ------------ 497 ------------------ 522 --------------- 579 --------- 613 ------------ 625 --------------- 708 ------------------ 759 --------------------- 847 ------ 876 --------------- 880 ------------ 904 --------- 911 Reported height: 8 Inserting 370... ------------ 90 --------- 162 ------------ 242 --------------- 308 ------ 341 --------- 370 --- 388 --------- 390 ------ 401 438 --- 488 ------------ 497 ------------------ 522 --------------- 579 --------- 613 ------------ 625 --------------- 708 ------------------ 759 --------------------- 847 ------ 876 --------------- 880 ------------ 904 --------- 911 Reported height: 8