Inplace heapsort


what is wrong in this code?

Hey @shubhangis248 I have noticed 2 mistake in your correct I.e., you are taking 1 input outside for loop and then n inputs inside for loop which makes total of n+1 inputs whereas we have to take only n inputs. Moreover in your print function you are not adding an endl statement due to which output format won’t be correct.


I would suggest you to see this code and take reference from it https://ide.codingblocks.com/s/299515?_ga=2.123188171.1910915811.1600971249-586887292.1600971249
:slight_smile: