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

Correct Answer (Detailed Explanation is Below)

B. N - 1

Detailed Explanation

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.