Heap Sort
Builds a max heap from the array, then repeatedly extracts the maximum element to build the sorted array.
Time ComplexityBestO(nlogn)AvgO(nlogn)WorstO(nlogn) Max OperationsWorst-case bound2n⋅log2(n) Used for efficiency calculation in Stats Panel
Space ComplexityAuxO(logn) Recursive heapify — call stack depth = tree height