Running Median — Solution & Editorial
Two heaps: a max-heap for the lower half and a min-heap for the upper half, rebalanced so the lower half holds the extra element; its top is the lower median.
Complexity: O(N log N)
Two heaps: a max-heap for the lower half and a min-heap for the upper half, rebalanced so the lower half holds the extra element; its top is the lower median.
Complexity: O(N log N)