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.
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
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.
Related questions:
2026: 31 May Shift 1
2025: 30 May Shift 2
2026: 21 May Shift 1
2026: 20 May Shift 1
2025: 21 May Shift 1