Least You Need to Know: Heaps, Heap Invariants, and Fast Extremes
باز کردن درس
A heap stores items so the **root is always the minimum or maximum** according to a priority rule. It does not fully sort everything, but it lets you update the frontier quickly when you repeatedly need the next best element.