Question 9431 – Binary-search-tree
November 26, 2023Question 9891 – Sorting
November 26, 2023GATE 2005
Question 35
|
How many distinct binary search trees can be created out of 4 distinct keys?
5
|
|
14
|
|
24
|
|
42
|
Question 35 Explanation:
There are 2nCn / (n+1) unlabeled trees are possible.
(or)
t(0)=1
t(1)=1
t(4) = t(0)t(3) + t(1)t(2) + t(2)t(1) + t(3)t(0)
= 5+2+2+5
= 14
(or)
8C4 / 5 = 14
(or)

t(0)=1
t(1)=1
t(4) = t(0)t(3) + t(1)t(2) + t(2)t(1) + t(3)t(0)
= 5+2+2+5
= 14
(or)
8C4 / 5 = 14
Correct Answer: B
Question 35 Explanation:
There are 2nCn / (n+1) unlabeled trees are possible.
(or)
t(0)=1
t(1)=1
t(4) = t(0)t(3) + t(1)t(2) + t(2)t(1) + t(3)t(0)
= 5+2+2+5
= 14
(or)
8C4 / 5 = 14
(or)

t(0)=1
t(1)=1
t(4) = t(0)t(3) + t(1)t(2) + t(2)t(1) + t(3)t(0)
= 5+2+2+5
= 14
(or)
8C4 / 5 = 14
Subscribe
Login
0 Comments