Mental Model
We use a max heap to keep track of the largest elements so we can quickly find the kth largest by removing the largest elements one by one.
Analogy: Imagine a pile of books stacked by height. The tallest book is on top. To find the kth tallest book, you remove the tallest books one by one until you reach the kth.
Max Heap Array Representation:
[ 9, 7, 8, 5, 6, 3, 4 ]
Heap Tree:
9
/ \
7 8
/ \ / \
5 6 3 4
ā (root is largest)