Data Structures & AlgorithmsModerateGATE CSE · Trees

How many structurally different binary search trees can be built from 5 distinct keys?

  1. A. 32
  2. B. 120
  3. C. 42
  4. D. 14

Correct answer: C. 42

The count is the Catalan number C5 = (1/6) x C(10,5) = 42.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic