A sort algorithm that builds a heap, then repeatedly extracts the maximum item. Run time is O(n log n).