Which statement best characterizes Selection Sort (as the code is written in this module)? Recall that a stable sorting algorithm maintains the relative order of records with equal keys.

Selection Sort is not stable, but with minor modifications it could be made so
  • Selection Sort is stable
  • Selection Sort is not stable

Think of the behaviour of every pass through the inner for loop of Selection Sort if two records are equal, with the greatest value in the array.

Which record will be selected?

The first such record.

It will be moved to the last position in the array, putting it out of order with other equal-valued records.

But we could easily change the maximum-finding part of the loop to take the last of these equal-valued records.