Q5. Deletion From Heap

Q5. Deletion From Heap
For deleting any arbitrary element from a min heap in what best complexity you can achieve this?

Doubt: How is deleting a random node from heap an O(n) operation?

The deletion of a random node would take O(n+log(n)) as first we will find where the random element is in the heap which will take O(n) and then delete it which will further take O(log(n))

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.