Add median using heaps