Heap Sort (Implementation)

(Reading time: 3 minutes)

To make a heap out of an array, we first need to go over all the items in the array, from right to left. This is necessary, as we start at the leaves. It receives the array we want to sort, and invokes the function that makes a heap on every element.

Get hands-on with 1200+ tech skills courses.