siftdown
Siftdown, also written sift-down, is a heap operation used to restore the heap property by moving a node downward through a binary heap. It is one of the fundamental sifting procedures used to maintain the ordering invariant in array-based heaps after certain updates, such as removing the root or replacing it with the last element.
In a min-heap, the heap property requires that every node is less than or equal to its
Siftdown is commonly used after removing the root element from a heap or after moving the last
In programming libraries, siftdown appears as an internal helper in heap implementations. For example, Python’s heapq