in DS retagged by
389 views
0 votes
0 votes

in DS retagged by
389 views

1 comment

correct answer would be (C).

No of binary tree possible with $6$ node =$\frac{\binom{2n}{n}}{n+1}$=$\large \frac{\binom{12}{6}}{7}=132$

No of min heap possible with $6$ node = $\large \binom{5}{3}*\binom{2}{1}*\binom{1}{1}=20$

Due to symmetry ,No of max heap possible with $6$ node = $\large \binom{5}{3}*\binom{2}{1}*\binom{1}{1}=20$

So ,with 6 nodes total number of min/max heap possible =$(20+20)=40$

So ,Probability that a binary tree is a heap = $\large \frac{40}{132}=\frac{10}{33}$
1
1

Please log in or register to answer this question.