Link to code-> https://ide.codingblocks.com/s/606488
Getting Wrong Output for this code to push and pop in a heap
@ikshuldureja130 in line no 71 of your code you have to swap the v[1] and v[last_index] element and you are swaping v[1] and last_index which is wrong
Coding Blocks IDE
this is the changed code it will work fine if your issue still exists let me know and if clear please mark it as resolved
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.