Median maintenance solution using heaps.