switchMaxHeap(), switchMinHeap() runs in O(n)