Mental Model
We use a max heap to keep the largest numbers at the top so we can quickly find the kth largest by removing the largest elements one by one.
Analogy: Imagine a pile of books stacked by size with the biggest on top. To find the kth biggest book, you remove the biggest books from the top until you reach the kth one.
Max Heap Array Representation:
[ 50, 30, 40, 10, 20 ]
Heap Tree:
50
/ \
30 40
/ \
10 20
ā root (largest)