Not getting proper op

inputs are given at the end of the code

Hey @premang these are some mistakes:

  1. don’t reserve vector size! (no need)
  2. your heapify function is incorrect as you check only for one level!, I have created another heapify_correct function!
    https://ide.codingblocks.com/s/263744
1 Like

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.