Question: Part A - Consider a binary search tree ( BST ) . Assume that the keys are integers and no value ( objects ) other

Part A- Consider a binary search tree (BST). Assume that the keys are integers and no value (objects) other than the key is stored in each node. By following the explanations and examples given in class, design an algorithm in pseudo-code for operation remove(k). Use java programming language, implement the BST ADT in a linked structure, along with the following operations: search, insert and remove.
Part B- Implement the InOrder traversal strategy, which shows the keys of the BST in increasing order.
Following the InOrder traversal strategy, write a program (or a method) that draws the BST and shows it on the screen (either console or GUI screen is acceptable).
Part C-Insert 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 in the tree (in that order). Show all keys in the tree (for this and the following, use the InOrder traversal method you implemented in Part B).
Perform search(1) and search(15)100,000 times and record the CPU time taken by each of these.
Remove key 5. Show all keys in Inorder traversal. Remove 15. Show all the keys in Inorder traversal. Remove 1. Show all the keys in Inorder traversal. Insert key 2. Show all keys in Inorder traversal.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!