Chapter 4: Problem 34
Use a greedy approach to construct an optimal binary search tree by considering the most probable key, Key \(_{k}\), for the root, and constructing the left and right subtrees for \(K e y_{1}, K e y_{2}, \ldots\) Keyk-1 and Keyk+1, Keyk+2,..., Keyn a. Assuming the keys are already sorted, what is the worst-case time complexity of this apporach? Justify your answer. b. Use an example to show that this greedy approach does not always find an optimal binary search tree.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.