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 max heap
Repeat extraction until heap size is 1
Sorted array obtained
Heap sort builds a max heap, then repeatedly extracts the largest element by swapping root with last, shrinking heap, and heapifying root.
