GATE Computer ScienceVery hardGATE CSE

How many structurally distinct binary search trees on 6 keys have height exactly 3, where height is the number of edges on the longest root-to-leaf path?

  1. A. 40
  2. B. 48
  3. C. 34
  4. D. 44

Correct answer: A. 40

Count shapes with height ≤ 3 and subtract those with height ≤ 2: 44 − 4 = 40.

More Programming and Data Structures (GATE) questions

Exams that ask this topic