Question 95Asked in BPSC TRE 3.0 (2024) Computer Science Class 11-12

How many distinct binary search trees can be created out of 4 distinct keys?

  1. A8
  2. B24
  3. C14
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) 14

Explanation

The number of distinct BSTs on n keys is the Catalan number C(n) = (2n)!/((n+1)! n!). For n = 4, C(4) = 14.

From BPSC TRE 3.0 (2024) Computer Science Class 11-12 — Previous Year Paper

This is question 95 of BPSC TRE 3.0 (2024) Computer Science Class 11-12 — Previous Year Paper. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.