edited by
12,444 views
32 votes
32 votes

How many distinct BSTs can be constructed with $3$ distinct keys?

  1. $4$
  2. $5$
  3. $6$
  4. $9$
edited by

2 Answers

Best answer
44 votes
44 votes

For number of distinct BSTs with $n$ nodes we apply the formula

$\dfrac{C(2n,n) }{n+1}$

$n=3$ here, so $C(6,3)=20$

So, $\frac{C(2n,n)}{n+1} =20/4=5$

Answer is $\mathbf{5}$

REF :- https://gatecse.in/number-of-binary-trees-possible-with-n-nodes/

Correct Answer: $B$

edited by
Answer:

Related questions