bubbledown
Bubbledown is a term used in computer science to describe the process of restoring the heap property in a binary heap by moving a node downward within the tree. It typically occurs after removing the root element or after replacing the root with the last element during heap operations. In many sources the operation is called sift-down, sink, or heapify-down, and bubbledown is used interchangeably in some contexts.
Algorithmically, bubbledown operates on a heap stored in an array. For a node at index i (using
Complexity and notes: Bubble-down runs in O(log n) time in a binary heap and typically O(1) extra