Question: Consider the binary search tree T below: (11) 17 10 15) (12 (16) a) What is the purpose of the following algorithm? Why? BSTalg(i) 1.

Consider the binary search tree T below: (11) 17 10 15) (12 (16) a) What is the purpose of the following algorithm? Why? BSTalg(i) 1. if left(i)=null 2. return i 3. else 4. return BSTalg(left(i)) b) What is the upper bound limit for the algorithm in (a)? Justify your answer. c) Consider the process of adding a new node in the above tree. Write an algorithm that could be used to perform the task. d) With clear explanations in each case, find the best case, average case and worst case for the algorithm in (c)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
