heap (priority queue with O(logn) operations) maintains elements with efficient access to the minimum or maximum, supporting insert and extract in O(logn). You use it when repeatedly finding the smallest or largest element from a changing collection. Heaps enable O(nlogn) sorting and O(nlogk) selection of top k elements.
You'll see this in scheduling, merging, and streaming data problems. Understanding these concepts deeply helps you solve related problems faster. Take time to internalize the pattern.