previous | index | next

Selection Sort Outer Loop

Each pass through the array scans through a successively smaller part, starting with an upper index of SIZE - 1.

We use n for a loop control variable and decrement it at each step:

    for (int n = SIZE-1; n > 0; n--) {
       ...
    }

previous | index | next