Click here to Skip to main content
15,868,009 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
given a min-heap H of size (number of nodes) (2^k)-1, what is the minimum number of comparisons and swapping required to convert H as max-heap?
Posted
Updated 2-Nov-13 20:17pm
v2
Comments
Zoltán Zörgő 3-Nov-13 2:17am    
Homework, eh?
Richard MacCutchan 3-Nov-13 3:41am    
42.

1 solution

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900