Sorting · Class 12 · CBSE · Science Computer Science

In an ascending selection sort, what will the list [64, 25, 12, 22, 11] become after the first pass?

Practice question from Sorting (Class 12 · CBSE · Science Computer Science), with the correct answer and a step-by-step solution.

easy · MCQ · Q-91B611

In an ascending selection sort, what will the list [64, 25, 12, 22, 11] become after the first pass?

  1. A.[11, 25, 12, 22, 64]Correct answer
  2. B.[25, 64, 12, 22, 11]
  3. C.[12, 25, 64, 22, 11]
  4. D.[64, 25, 12, 11, 22]

Solution

In the first pass, selection sort finds the smallest element in the entire list, which is 11, and swaps it with the first element 64. The resulting list is [11, 25, 12, 22, 64].

More from Sorting

All of Sorting

Practise more Computer Science

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed