What is the maximum height of a Binary Search Tree containing N nodes?
Options
- A. log2(N)
- B. N - 1
- C. N / 2
- D. More than one of the above
- E. None of the above
Quiz Practice:
B. N - 1
For a binary tree containing N nodes, the maximum height is Nā1 when height is measured as the number of edges on the longest root-to-leaf path. This occurs when the tree is completely skewed, with every node having only one child. A BST can become skewed when keys are inserted in sorted or nearly sorted order. Such a tree behaves similarly to a linked list.