Question
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
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.
Deliverables:
Source code for your classes
A main file that tests the classes with above steps.
Makefile to compile your code(if you have any).
Test output of your codes.
README FILE explaining the compilation process, missing(or incomplete parts)
1 Randomly generate 100 unique vales in the range of[1-200 and insert them into a binary search tree (BST1) Print height and inorder utput of the BST1 tree 2 Randomly penerate 10 unie values in the range of[1-200] where there is an overlap with the previous aues and insert them into another binary search tree (BST2) Print preorder, inorer, and pastorder onutput of the BST2 tree 3 Fund and remove any values of BST2 from BST1, Print height, mumber of nodes, the modified BST1 tree 4 Clear the binary search trees Print whether trees are empty before and after clear operation and inorder output of Note. You can omit any operation that is notqied fo the above steps. Bonus [I points]. Run the algorithas with 100,000 values in the range of[-100,000] in BST Deliverables: 1. Source code for your classes 2. A main file that tests the classes with abore steps 3. Makefile to compile yur codelif you have any) Test output of your codes . README FILE explaining the compilation process, missing(or incomplete parts) 1 Randomly generate 100 unique vales in the range of[1-200 and insert them into a binary search tree (BST1) Print height and inorder utput of the BST1 tree 2 Randomly penerate 10 unie values in the range of[1-200] where there is an overlap with the previous aues and insert them into another binary search tree (BST2) Print preorder, inorer, and pastorder onutput of the BST2 tree 3 Fund and remove any values of BST2 from BST1, Print height, mumber of nodes, the modified BST1 tree 4 Clear the binary search trees Print whether trees are empty before and after clear operation and inorder output of Note. You can omit any operation that is notqied fo the above steps. Bonus [I points]. Run the algorithas with 100,000 values in the range of[-100,000] in BST Deliverables: 1. Source code for your classes 2. A main file that tests the classes with abore steps 3. Makefile to compile yur codelif you have any) Test output of your codes . README FILE explaining the compilation process, missing(or incomplete parts)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started