Mental Model
Heap sort organizes data into a special tree shape called a heap, then repeatedly removes the largest item to sort the list.
Analogy: Imagine a pile of boxes stacked so the biggest box is always on top. You take the biggest box off one by one to get a sorted line of boxes from biggest to smallest.
Array: [4, 10, 3, 5, 1]
Heap (max-heap):
10
/ \
5 3
/ \
4 1
