Heap quiz doubt

max no is already on root so it should be 0 interchange na?

Hey @guptashubham210a
You can see 89 is largest and on top but computer doesn’t know that. and its not a heap since all elements do not satisfy heap property.
so u have to make a heap with these elements and count interchanges in it .
There will be 2 swappings for the last element 70 ,for rest of the elements heap property is already satisfied.
So answer is 2

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.