How many distinct binary search trees can be created out of 4 distinct keys?
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.
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.
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.