Selection Sort: Tracing Exercise

Please run the selection sort code in "debug" mode for the following sequence of values:

$$ 14, 10, 23, 34, 6, 17, 50, 14 $$

You can use the unit test in SortingAlgorithmTest for this purpose.

Exercise complete the following trace table.

Making sense of the table!

Each row of the table above represents a complete inner pass through the selection sort algorithm. Two complete passes have been filled as an example of the sort. The arrow in each row indicates where the smallest element in the unsorted part should go.

Solution