Design a data structure to efficiently calculate the running median of a sequence of integers. The sequence is presented as a stream, where each integer is added one at a time. For an even number of elements, the median should be the average of the two middle elements.
Running median using two heaps
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak