Apply bubble sort technique to sort a list of elements:
numList2 = [8, 7, 6, 5, 4]. Show the positions of elements in the list after pass 1.
Apply bubble sort technique to sort a list of elements:
numList2 = [8, 7, 6, 5, 4]. Show the positions of elements in the list after pass 1.
Solution
✅ Correct Option: 3
In pass 1, bubble sort compares each adjacent pair from left to right and swaps them if the left one is larger. This carries the largest element, 8, to the last position.
| Comparison | List after comparison |
|---|---|
| Start | 8 7 6 5 4 |
| 8 and 7: swap | 7 8 6 5 4 |
| 8 and 6: swap | 7 6 8 5 4 |
| 8 and 5: swap | 7 6 5 8 4 |
| 8 and 4: swap | 7 6 5 4 8 |
Option 4: this is the list after only 3 of the 4 comparisons, so pass 1 is not complete.
Option 2: this is the fully sorted list, which needs 4 passes for this input, not 1.
After pass , the largest elements are in their final positions at the end of the list.
Related questions:
2026: 23 May Shift 1
2026: 23 May Shift 1
2026: 19 May Shift 1
2025: 16 May Shift 1