Heap deletion algo

why the left subtree will always be a maxheap??

@shampblocks hey heap ek complete tree hai to apko last level ka sabse right most element ko swap krna hai root se,pura tree max heap hai ,not ki left one.

It was mentioned that when we are replacing element downheapifyng then we don’t have to consider other half for swapping in deletion how??

@shampblocks hey yes thats true suppose apne last node delete krdi ab heapify krna hai to app khali usi subtree se root pr jaoge na upheapify krte hue ,baki rest tree ko to koi affect nhi pdega ,suppose right subtree me se dlete kia last ellement wha se up heapify krte hue root tak gye so left subtree of root to abhi bhi heap hi tha uska kuch change nhi hua.Hope you get it :slight_smile:

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.