Heapsort will sort an array by first heapifying then transferring the first element to the new array and deleting it from the original heap.
The complexity of heapsort is $\Theta(n \ \log \ n)$.
# applications
- priority queue: a type of queue where each element has a priority, and you want to process the highest priority first. Use a min heap.