Implement a binary search tree that stores ints (using a BinaryTree that stores Integers as the data structure); and then use that to implement and time tree sort. Compare the running times with those of merge or quick sort whichever sort you implemented.
To aid debugging, display the BST visually so it looks at least vaguely like a tree. If the inputs to your tree were: 10, 1, 3, 88, 100, 77, then displaying 10, 1, 3, 88,77, 100 would not be sufficient. Instead, it would be much nicer to display something like:
100
88
77
10
3
1
(If you don't see that as a tree, try tipping your head to the left, think of 10 as the root, and use your imagination.) This is straightforward, if you understand two things.
display()
as:
void display() { if (!empty()) { // i.e. if not the base case (where we do nothing!) display right display root display left } }
Demonstrate your program for credit;