1 Problem 1 25 Pts Given Sequence Numbers 20 7 34 29 43 40 8 12 30 42 7 Pts Show Resulting Q37039429

1. Problem 1 [25 pts]: Given the sequence of numbers: 20, 7, 34,29, 43, 40, 8, 12, 30, 42

(a)[7 pts] Show the resulting BST after inserting the numbers askeys.

(b)[9 pts] What will be the resulting tree if you delete theroot? Show the tree and explain the steps taken in deleting theroot according to the delete procedure we discussed in class.

(c)[9 pts] Can you reorder the original sequence of numbers toobtain a tree of a smaller height? If, yes, show the permutation ofthe sequence and the new tree. If no, argue why a smaller height isnot obtainable.


Answer


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.