Heap Sort

Heap Sort Animation (Without Binary Tree Visual)


Heap Sort (With Binary Tree Visual)


Heap Sort Infographic


Methodology

  • Create initial max heap

  • Repeat until heap runs out of nodes:

    • Swap the last node with max node

    • Remove max node and push onto stack

    • Heapify root node

Complexity

Time Complexity: N log(N)
Space Complexity: N
Unstable


Previous
Previous

Comb Sort

Next
Next

Quick Sort