previous | index | next

Selection Sort Revisited

Example:

Unsorted Sorted
2 6 3 8 5 4 1 7                
2 6 3   5 4 1 7               8
2 6 3   5 4 1               7 8
2   3   5 4 1             6 7 8
2   3     4 1           5 6 7 8
2   3       1         4 5 6 7 8
2           1       3 4 5 6 7 8
            1     2 3 4 5 6 7 8
                1 2 3 4 5 6 7 8

See the algorithm for sorting numbered cards on page 77.


previous | index | next