Consider the following list of six elements:
numList= [8, 7, 13, 1, -9, 4]
Arrange the following output after each pass in increasing order of passes after applying insertion sort on the above list.
(A) [1, 7, 8, 13, -9, 4]
(B) [-9, 1, 4, 7, 8, 13]
(C) [7, 8, 13, 1, -9, 4]
(D) [-9, 1, 7, 8, 13, 4]
Consider the following list of six elements:
numList= [8, 7, 13, 1, -9, 4]
Arrange the following output after each pass in increasing order of passes after applying insertion sort on the above list.
(A) [1, 7, 8, 13, -9, 4]
(B) [-9, 1, 4, 7, 8, 13]
(C) [7, 8, 13, 1, -9, 4]
(D) [-9, 1, 7, 8, 13, 4]
Solution
✅ Correct Option: 1
Insertion sort takes each element in turn and inserts it into its correct place in the sorted part on its left.
| Pass | Element inserted | List after the pass |
|---|---|---|
| 1 | 7 | [7, 8, 13, 1, -9, 4] (C) |
| 2 | 13 | [7, 8, 13, 1, -9, 4] (no change, so same as C) |
| 3 | 1 | [1, 7, 8, 13, -9, 4] (A) |
| 4 | -9 | [-9, 1, 7, 8, 13, 4] (D) |
| 5 | 4 | [-9, 1, 4, 7, 8, 13] (B) |
The order is (C), (A), (D), (B).
Passes 1 and 2 give the same list because 13 is already larger than 8, so nothing moves in pass 2.
Related questions:
2025: 3 June Shift 2
2026: 20 May Shift 1
2026: 13 May Shift 2
2026: 21 May Shift 1