heap sort: iterative version of MaxHeapify