Mental Model
We use a min heap to always get the smallest number quickly. By removing the smallest number k times, the last one removed is the kth smallest.
Analogy: Imagine a pile of numbered cards. You keep picking the smallest card from the pile one by one. The card you pick on the kth turn is the kth smallest.
Min Heap Array: [2, 3, 5, 7, 8]
Heap structure:
2
/ \
3 5
/ \
7 8