Heap Sort
Read Heap for background.
Heap sort uses a max-heap, to maintain ascending order.
Steps :
- Build max heap (
) - Swap root with last element
- Reduce heap size by popping last element (effective extraction)
- Heapify root
- Repeat
Select a result to preview
Read Heap for background.
Heap sort uses a max-heap, to maintain ascending order.