Complete binary tree in an array: every parent beats its children. Always grab the extreme — the priority queue.
Push 1 → sifts up to the root. Pop → last leaf to root, sifts down. Never fully sorted — just parent < children.
peek O(1) · push/pop O(log n) · build O(n). heapq ≈13× faster (C).
heapq is a MIN-heap — negate for max; push (priority, item) tuplesMinimum effort to answer one question: what's the extreme? The engine of Dijkstra, Prim, Huffman, schedulers. Next: tries.