medianHeap implementation in C++