maxHeap implemented in C++