Consider a list of elements:
numList =[8,7,13,1,-9,4].
Determine the partially sorted list after three complete passes of the list using insertion sort.
Consider a list of elements:
numList =[8,7,13,1,-9,4].
Determine the partially sorted list after three complete passes of the list using insertion sort.
Solution
✅ Correct Option: 4
Insertion sort treats the first element as already sorted. Each pass takes the next element and inserts it into its correct place in the sorted part on the left.
| Pass | Element inserted | List after the pass |
|---|---|---|
| 1 | 7 | [7,8,13,1,-9,4] |
| 2 | 13 (already in place) | [7,8,13,1,-9,4] |
| 3 | 1 (moves to the front) | [1,7,8,13,-9,4] |
Option 1: this is the list after pass 1 (and also after pass 2), not pass 3.
Option 3: this is the fully sorted list, which needs five passes.
Related questions:
2026: 21 May Shift 1
2026: 18 May Shift 2
2026: 23 May Shift 2