1 votes 1 votes How come the answer is 8 I think it shoulb be 4. DS made-easy-test-series data-structures binary-heap + – harshit agarwal asked Jan 14, 2017 • recategorized Mar 7, 2019 by adeebafatima1 harshit agarwal 721 views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply air1 commented Jan 14, 2017 reply Follow Share elements from the last level can also be placed as the right child of the root. 0 votes 0 votes harshit agarwal commented Jan 14, 2017 reply Follow Share Then I think that max heap will not be formed. 0 votes 0 votes Kapil commented Jan 14, 2017 reply Follow Share Can you try to design a max heap from this : $5,4,1,3,2$ $5,4,1,2,3$ $5,4,2,3,1$ $5,4,2,1,3$ 0 votes 0 votes air1 commented Jan 14, 2017 reply Follow Share i think these are valid max heaps. did you include them in your solution? 2 votes 2 votes Please log in or register to add a comment.
0 votes 0 votes 1. 5,4,3,2,1 2. 5,4,3,1,2 3. 5,3,4,2,1 4. 5,3,4,1,2. 5. 5,4,1,3,2. 6. 5,4,1,2,3. 7. 5,4,2,3,1 8. 5,4,2,1,3 Purvi Agrawal answered Jan 30, 2017 Purvi Agrawal comment Share Follow See 1 comment See all 1 1 comment reply rishu_darkshadow commented Sep 18, 2017 reply Follow Share is there any formula or relation to calculate this with n no. of nodes ?? 0 votes 0 votes Please log in or register to add a comment.