Similar questions 2 more →
Searching, Sorting & Selection

Answer & solution
Answer: C under the standard swap-based comparison (no official key was published)
1. Selection sort places the minimum remaining item in its final location with at most one exchange per pass, hence at most n−1 swaps. Standard swap-based insertion sort, quicksort and heapsort can use more.
2. Thus selection sort, C, in the conventional worst-case exchange-count comparison. A shift-based insertion implementation can avoid an explicit swap operation, so literal source-code swap counts are implementation-dependent.
3. Teaching check: Selection sort can inspect the entire unsorted suffix without moving any item, then exchange its minimum with the first unsorted position. This separates comparison count, Θ(n²), from exchange count, O(n). The question asks about swaps, not fastest running time.