Question: Help to answer following question thank you! 1. Insert the following numbers into an empty BST and draw the resulting tree: 43, 20, 9, 15.

Help to answer following question thank you!

1. Insert the following numbers into an empty BST and draw the resulting tree: 43, 20, 9, 15.

a) What is the height of the tree?

b) Is this a perfect binary tree?

c) This is not a complete binary tree. Make this a complete tree by inserting the minimal number of nodes needed. Draw your result.

2. Insert the following numbers into an empty BST and draw the resulting tree. 28, 32, 12, 47, 2, 16, 36, 1.

3. Remove the following numbers from the BST from step 2 using lazy removal: 32, 16, 50. Draw the resulting tree.

4. Now insert the following numbers into the BST from step 3: 40, 20, 16, 32. Draw the resulting tree.

5. Rewrite the FindMax method from the last slide for a BST with lazy removal.

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!