Mental Model
When we remove the top value from a heap, we replace it with the last value and then push that value down to restore the heap order.
Analogy: Imagine a pyramid of blocks where the top block is removed. You take the bottom block and place it on top, then slide it down to its correct spot so the pyramid stays stable.
Heap array: [10, 15, 20, 17, 25]
Index: [0, 1, 2, 3, 4]
Min-heap property: parent ≤ children
Before extract:
10
/ \
15 20
/ \
17 25
After removing 10, replace with 25:
25
/ \
15 20
/ \
17 null
Then bubble down 25 to restore heap.