Multiple choice

What is the 1st change that selection sort would make to this sequence to put into ascending order “3 1 4 2?

  1. 3 2 4 1

  2. 1 3 4 2

  3. 2 4 1 3

  4. 4 2 3 1

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Selection sort works by finding the smallest element in the unsorted portion and swapping it with the first element. In '3 1 4 2', the smallest is 1, so it swaps with 3 to get '1 3 4 2'.