What if you need to repeatedly find and remove the smallest element from a collection? An unsorted array gives per removal.
Keep the array sorted in reverse and the minimum sits at the end: removal, but insertion. Heaps balance both: insertion and removal, peek at the minimum.
In this section, you'll learn heaps, then learn patterns like -th element finding, merging sorted lists, and the two-heaps technique for running medians.