CS 206: Data Structures
Exercise#17
Due on Thursday, April 24
Implement a class for the Binary Search Tree data stype (as presented in class on Thursday, 4/17). Test your implementation using a main method in the implemented class. Specifically, use the following commands:
A. Use the add method to add the following strings to the BST:
After adding the above, do a preorder, postorder, and inorder traversal (printing out each node as you visit). Also print out the number of entries in the tree, and its height.
B. Clear the tree, and print out the number of items and its height. Then add the above towns in ascending order. Print out the resulting tree's size, and height, and also the results of all three tree traversals.
Hand in a complete prinout of your program along with the output.