Google News
logo
Algorithm - Quiz(MCQ)
Out of 4 distinct keys how many distinct primary keys can be created?
A)
5
B)
14
C)
20
D)
45

Correct Answer : Option (B) :   14


Explanation :

The no of keys given are 4
apply the formula Bn=1/(n+1)*(2n!/n!n!)
where B is the binary tree and n is the number of keys.
Bn=1/(4+1)*(8!/4!4!)
Bn=1/5*(8*7*6*5*4!)/4!4!
Bn=8*7*9*6/(4*3*2)
Bn=56/4
Bn=14
Hence, the total no of binary trees with n=4 is 14.

Advertisement