Arrange the following steps of Selection Sort in correct order.
A. Smallest element of the unsorted array is swapped with the leftmost element of the sorted array.
B. The smallest element is selected from the unsorted array.
C. The swapped element becomes a part of the sorted array.
D. The process continues for the next element in the unsorted array till the list is sorted.
Arrange the following steps of Selection Sort in correct order.
A. Smallest element of the unsorted array is swapped with the leftmost element of the sorted array.
B. The smallest element is selected from the unsorted array.
C. The swapped element becomes a part of the sorted array.
D. The process continues for the next element in the unsorted array till the list is sorted.
Solution
B. Find the smallest element in the unsorted part.
A. Swap it with the leftmost element.
C. The swapped element now becomes part of the sorted array.
D. Repeat the process for the remaining unsorted elements until the list is sorted.
Option 2: swapping (A) cannot come before selecting the smallest element (B).
Option 3: D is the repeat step, so it must come last, after the sorted part has been updated in C.
Related questions:
2026: 23 May Shift 1
2025: 13 May Shift 2
2025: 20 May Shift 1