← Back

Heap Sort

Build heap then repeatedly extract max/min to sort.

heapsortingUpdated 2025-09-01

Complexity

  • O(n log n)
  • In-place

Steps

  • Heapify
  • Swap root with end, reduce size, sift