Skip to main contentSkip to solution

Arrange the working of Selection Sort on a list in ascending order.

(A) The list is divided into two lists - the left list containing the sorted elements, and the right list containing the unsorted elements. Initially, the left list is empty, and the right list contains all the elements.

(B) The smallest element is swapped with the leftmost element of the unsorted list, occupies the first position in the sorted list, and is not considered in further passes.

(C) The process of finding smallest and swapping continues until n-1 smallest elements are found and moved to their respective places.

(D) All the elements in the unsorted list are traversed to find the smallest element.

Solution

✅ Correct Option: 1

Selection Sort starts by splitting the list into a sorted part (empty at first) and an unsorted part (all elements), which is (A). Next, the unsorted part is traversed to find its smallest element, (D). That smallest element is then swapped with the leftmost unsorted element and joins the sorted part, (B). The find-and-swap process repeats until n-1 smallest elements are placed, (C).


Option 3: (C) describes the repetition of finding and swapping, so it cannot come before (B), the first swap.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question