Question discussion

How many structurally different binary search trees can be built with 4 distinct keys?

1138Medium DSSSB TGT Computer Science 0 replies 1 views
0

How many structurally different binary search trees can be built with 4 distinct keys?

  • A14
  • B12
  • C16
  • D24
Correct answer: A

Explanation

The number of BSTs with n keys is the Catalan number C(2n, n)/(n + 1); for n = 4 it is 70/5 = 14.

Discussion 0

Nobody has replied yet. Start the discussion!