Using insertion sort for descending order?

To sort in descending order, you only need to change the comparison:

while (j > 0 && arr[j - 1] < valueToSort) {

Note the < instead of >.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)