Medium

Heap Sort

Heap sort builds a heap in the array, then repeatedly moves the root to the end. Building the heap is linear. Each of the n removals is logarithmic.

Costs

CategoryAlgorithm
DifficultyMedium
TimeO(n log n)
Extra memoryO(1)
Stableno

Questions

What is Heap Sort?

Heap sort builds a heap in the array, then repeatedly moves the root to the end. Building the heap is linear. Each of the n removals is logarithmic.

Where do I practice it?

DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.