Now that we know how to create a max-heap, we’ll move into sorting an array of values using heap sort. To sort the array using heap sort, we’ll keep creating max-heaps. Each time a max-heap is created, the root is removed and is considered sorted. Let’s start with the following example.

#heapsort #computer-science #sorting-algorithms #programming #algorithms

Heap Sort Algorithm Visually Explained
1.55 GEEK