Heap function does not give perfect output

can you checkout my code

@jatinkumarjk2001
I’ve corrected your code here
Please see this https://ide.codingblocks.com/s/215314

your code is not give correct output
not a heapsort code;
you are just doing downheapification i need to do heapsort

@jatinkumarjk2001
Heap sort works by heapifying only. You insert an element at the bottom and call upheapify.
Also I didn’t modify any logic. I just fixed the issues. So if you feel heapsort is different than it should be please first refer to a heapsort code and modify your function accordingly.
You can refer this https://www.geeksforgeeks.org/cpp-program-for-heap-sort/

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.