Maintain two heaps: lower half (max-heap) and upper half (min-heap).
Heaps keep halves ordered: all small <= large, and sizes differ by at most 1.
Maintain two heaps: lower half (max-heap) and upper half (min-heap).
Heaps keep halves ordered: all small <= large, and sizes differ by at most 1.