Given array [50, 40, 60, 30, 70]
How many passes will be required to sort the array using a selection sort?
Given array [50, 40, 60, 30, 70]
How many passes will be required to sort the array using a selection sort?
Solution
✅ Correct Option: 3
Selection sort places one element in its final position per pass. After passes the last element is automatically in place, so for the number of passes is .
| Pass | Position filled | Minimum found in unsorted part | Array after pass |
|---|---|---|---|
| 1 | 1st | 30 | 30, 40, 60, 50, 70 |
| 2 | 2nd | 40 | 30, 40, 60, 50, 70 |
| 3 | 3rd | 50 | 30, 40, 50, 60, 70 |
| 4 | 4th | 60 | 30, 40, 50, 60, 70 |
Option 4 (5): a fifth pass would only compare the last element with itself, so it is not needed.
Related questions:
2025: 16 May Shift 1
2026: 21 May Shift 1