push
RU: push
The heap operation that adds a new element: append it at the end of the array in O(1), then sift it up to restore the heap property in O(log n). Total cost is O(log n).
RU: push
The heap operation that adds a new element: append it at the end of the array in O(1), then sift it up to restore the heap property in O(log n). Total cost is O(log n).