Skip to main contentSkip to solution

In the context of the Selection Sort Algorithm for ascending order, arrange the following sequences:

(A) The list is considered to be divided into two lists - the left list contains sorted elements, while the right list contains unsorted elements.

(B) The smallest element is then swapped with the leftmost element of the unsorted element.

(C) This process 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: 4

The order is A, D, B, C.

Selection sort first views the list as a sorted left part and an unsorted right part (A). It then scans the whole unsorted part to find the smallest element (D). That smallest element is swapped with the leftmost element of the unsorted part (B), which grows the sorted part by one. The scan and swap repeat until n−1n-1 smallest elements are in place (C).


Options 1 and 3: the swap (B) cannot come before the scan (D), because the smallest element must be found before it can be swapped.

Option 2: scanning (D) cannot come before the list is split into sorted and unsorted parts (A), because the scan runs only over the unsorted part.

Only n−1n-1 passes are needed because the last remaining element is automatically in its correct place.

Keyboard Shortcuts

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