1. Suppose that we have numbers between 1 and 100 in a binarysearch tree and want to search for the number 34. Which of thefollowing sequences CANNOT be the sequence of nodes examined?
a. 10, 56, 45, 18, 25, 31
b. 89, 43, 10, 17, 37, 30
c. 20, 56, 32, 37, 41, 18
d. 42, 9, 11, 29, 39,35
2. What are the worst-case complexities of insertion anddeletion of a key in a binary search tree?
a. O(n) for both insertion and deletion
b. O(logn) for both insertion and deletion
c. O(n) for deletion, O(logn) for insertion
d. None of the above
Answer
1.c. 20, 56, 32, 37,
OR
OR