Extracted drainHeap in heap-sorts