in the code explained in the video we are using idx=v.size()-1 but in this case value of idx will be zero which we don’t have to use also in while loop we are using condition idx>1 then what about the case in which we have to insert element at 1 index
In insertion code of heap
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.