Data Structures & AlgorithmsVery hardProduct-company MCQ pattern

Keys 34, 69, 39, 53, 61, 76, 35 are inserted in this order into an empty BST (no rebalancing). What is the height of the tree (edges on the longest root-to-leaf path)?

  1. A. 4
  2. B. 2
  3. C. 3
  4. D. 5

Correct answer: A. 4

Inserting keys in this order without rebalancing produces a tree whose deepest leaf is 4 edges below the root. 2 would be the height of a *balanced* tree with 7 nodes, which insertion order alone does not guarantee.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic