Here i have implemeted to convert a vector into heap…
But it is showing some different output than video…
Please check this… if i implemented in correct way or not…
Thanks
Check this function
Hii…
Inupt is–
8
10 20 5 6 1 8 9 4
Output is–
20 10 8 9 1 5 6 4
Video output–
20 10 9 6 1 5 8 4
see order of data of heap may very from implementation to implementation , so its totally fine if ur output didnt match with video ouput.
to check whether u r getting correct output or not ,try to implement heap sort and pop element one by one ,if u get data in sorted form that means ur code is correct