Build a heap from array in O(N) time


it should print 20,10,9,6,1,8,5,4
where it is wrong

It’s working now https://ide.codingblocks.com/s/575583. Are you ignoring -1?

Yes not considering -1 in heap. What change have you done?

Check the compare function

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.