Build heap from array in o(n)

my code is not working help–>

hello @sheikhhaji18
it is working.
to verify the output try to implement heapsort using the same heap.
and check whether output is sorted or not

my fault i thought i was implementing maxheap

but it was implementing minheap


it is correct now

yes ,this is mX Heap now

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.