Selection sort is applied to <code>{8, 3, 5, 1, 9, 2}</code>. After ONE pass (pass 0), what does the array look like?
- A
[3, 5, 1, 8, 9, 2]
- Bcheck_circle
[1, 3, 5, 8, 9, 2]
- C
[3, 5, 1, 9, 2, 8]
- D
[1, 3, 5, 8, 2, 9]
Explanation
Pass 0 finds the minimum (1, at index 3) and swaps it with index 0, giving [1, 3, 5, 8, 9, 2]. The rest of the array is unchanged.