Heap (binary heap)
A priority queue you can grep.
Williams introduced the heap in his 1964 heapsort paper — and accidentally invented the priority queue. The structure is a complete binary tree where each parent is ≤ its children (min-heap) or ≥ (max-heap), stored in an array using arithmetic indexing.
For node at index i: parent at (i−1)/2, children at 2i+1 and 2i+2. Insert appends and "sifts up"; extract-min replaces root with last leaf and "sifts down". Both are O(log n).
Dijkstra's algorithm. A* pathfinding. Job schedulers. Linux kernel's timerfd. heapq in Python's standard library. Top-k aggregations in Spark, Flink, ClickHouse.
The "build heap in O(n)" result is one of the prettiest in algorithm analysis. Bottom-up heapify costs n × Σ(height/2^level) = O(n) — not O(n log n) as you'd expect.