Re-adjusting a binary heap after removing the minimum element
- by BeeBand
After removing the minimum element in a binary heap, i.e. after removing the root, why is the last leaf then assigned to the root and sifted down?
Why not take the lesser child of what used to be the root and just keep sifting up all the children? Isn't this the same amount of operations, so why is the "sift down" method preferred?