Concept Flow - Heap sort algorithm
Build Max Heap from array
Extract max element (root)
Swap root with last element
Reduce heap size by 1
Heapify root to restore heap
Repeat extraction until heap empty
Sorted array
Heap sort first builds a max heap, then repeatedly extracts the largest element by swapping it with the last heap element and restoring the heap, until the array is sorted.