1 votes 1 votes 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 ________. DS made-easy-test-series data-structures binary-heap + – sunaina rawat asked Nov 7, 2017 edited Mar 4, 2019 by adeebafatima1 sunaina rawat 732 views answer comment Share Follow See all 8 Comments See all 8 8 Comments reply Upasana singh commented Nov 7, 2017 reply Follow Share I am getting a very big number as the answer. Could you please tell the answer? 0 votes 0 votes srestha commented Nov 7, 2017 reply Follow Share 64?? 0 votes 0 votes sunaina rawat commented Nov 7, 2017 reply Follow Share no it is 1935360 0 votes 0 votes Anu007 commented Nov 7, 2017 i edited by Anu007 Nov 7, 2017 reply Follow Share https://www.quora.com/How-many-Binary-heaps-can-be-made-from-N-distinct-elements https://gateoverflow.in/102171/min-heap But correct answer is 21964800. 1 votes 1 votes Upasana singh commented Nov 7, 2017 reply Follow Share @Anu007 But Here we have the constraint that "every leaf node must be greater than all non-leaf nodes" Then how could the answer be 21964800? 0 votes 0 votes Anu007 commented Nov 7, 2017 reply Follow Share i think in min heap all leaf have greater value than nonleaf. 0 votes 0 votes Upasana singh commented Nov 8, 2017 reply Follow Share @Anu007 No not necessarily.Consider the min heap 1 2 4 3 5 6 7 Here on the leaf nodes we have 3 5 6 7 1 votes 1 votes shashankrustagi commented Jan 2, 2021 reply Follow Share yes upasana you are correct! 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes for root and leaf nodes it is fixed. for remaining 6 nodes we have 6C3*2*2 total=8!*6C3*2*2 =3225600 arun yadav answered Sep 18, 2020 arun yadav comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments arun yadav commented Jan 2, 2021 reply Follow Share leaves will arranged in 8! ways 0 votes 0 votes shashankrustagi commented Jan 2, 2021 reply Follow Share thats fine but why are you making 8! just simply calculate it for 15 nodes 0 votes 0 votes arun yadav commented Jan 3, 2021 reply Follow Share because in question it is given that leaf node is greater than all non leaf node.so 8,9,10,11,12,13,14,15 should be present in leaves .so these 8 leaves will arranged in 8! ways 0 votes 0 votes Please log in or register to add a comment.