CS 302 - Data Structures
Programming Assignment 6: Binary Search Tree
Due on Tuesday, Nov 29 at 4 pm
Programming Problem 2 on Page 512. Remember that Chapter 16 provides details of how to implement binary search tree.
- Randomly generate 100 unique values in the range of [1-200] and insert them into a binary search tree (BST1). Print height and inorder output of the BST1 tree.
- Randomly generate 10 unique values in the range of [1-200] where there is an overlap with the previous values and insert them into another binary search tree (BST2). Print preorder, inorder, and postorder output of the BST2 tree.
- Find and remove any values of BST2 from BST1. Print height, number of nodes, and inorder output of the modified BST1 tree.
- Clear the binary search trees. Print whether trees are empty before and after clear operation.
Note: You can omit any operation that is not required for the above steps.
Bonus [1 points]: Run the algorithms with 100,000 values in the range of [1-100,000] in BST1.
- Source code for your classes
- Doxygen reports for code documentation
- A main file that tests the classes with above steps.
- Test output of your codes.
Teaching Assistant:Shehryar Masaud
What to turn in:
A softcopy of your sourcecode and reports should be uploaded to WebCampus. Compress all files as a single zip file.