Skip to content

Arrays: Sort descending

Task: Sort this array in descending order

01234423523178SETTLED8index 4 is final

What you are watching

Descending order is the same algorithm with one character changed. Each pass looks for the largest remaining value instead of the smallest and swaps it to the front of the unsorted region. Ascending and descending are not two techniques; they are one comparison pointing either way, which is why a sort takes a comparator.