HeapEvidence Contributing
Two Heaps (Median Maintenance)
Balance a max-heap of the lower half against a min-heap of the upper half to maintain a running median.
Practice Problems: 1
Difficulty: 0 Easy·0 Medium·1 Hard
Core technique
Review the technique, then try the mapped problems below. The right approach depends on each problem's constraints.
- Core Strategy: Balance a max-heap of the lower half against a min-heap of the upper half to maintain a running median.