Runtime error in heapsort
srijan in your pop function u did’t decrease the size which u are using int the heapify function i have make it correctly
https://ide.codingblocks.com/#/s/15490
just check out
1 Like
no need to keep track on the parent at first,make a function for heapsort where you will start the loop from i=n/2-1 and swap the current element of the array with root element and call the heapify function on the remaining