edited by
760 views

2 Answers

Best answer
6 votes
6 votes

at first level,there can be only 1..hence only 1 way

at second level,there can be 2 or 3 ,hence 2 ways

at third level,there can be 4,or 5 or 6 or 7 ,hence 4! ways

at fourth level,there can be 8 or 9or 10 or 11 or 12 or 13 or 14 or 15 ,hence 8! ways

so,total number of min heaps are 1*2* 4! * 8! ways . It looks like this ....


But actually, question only asks to handle leaf nodes not internal nodes, hence the numbers 2,3,4,5,6,7 can be arranged any way.

At root, 1 is for sure fixed, but for 2,3,4,5,6,7 , total ways will be 

$C(6,3) * 2! * 1 * 2! * 8! = 3225600 $ ways.


PS: $C(6,3)$ :- Choose any three elements for left $3$ positions and arrange them in $2!$ ways.

Then, right $3$ positions can be permuted in $2!$ ways .

selected by

Related questions


Deprecated: Implicit conversion from float-string "1543041799.108" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1543041799.108" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1543041799.108" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1543041799.108" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803
587
views
0 answers
1 votes
3.5k
views
2 answers
5 votes
Utkarsh Joshi asked Nov 24, 2018
3,537 views
The minimum number of comparisons required to find the 65th smallest element in a minheap is equal to
799
views
1 answers
1 votes
sunaina rawat asked Nov 7, 2017
799 views
The number of min heap trees are possible with 15 elements such that every leaf node must be greater than all non-leaf nodes of the tree are ________.
732
views
1 answers
1 votes
harshit agarwal asked Jan 14, 2017
732 views
How come the answer is 8 I think it shoulb be 4.