After two complete passes of Bubble Sort on the array [7, 2, 9, 4], what will the new order be?
A. 7
B. 2
C. 4
D. 9
After two complete passes of Bubble Sort on the array [7, 2, 9, 4], what will the new order be?
A. 7
B. 2
C. 4
D. 9
Solution
✅ Correct Option: 1
Bubble Sort compares adjacent elements and swaps them if they are in the wrong order. Each pass pushes the largest remaining element to the end.
| Pass | Comparisons | Array after pass |
|---|---|---|
| 1 | (7, 2) swap, (7, 9) no swap, (9, 4) swap | [2, 7, 4, 9] |
| 2 | (2, 7) no swap, (7, 4) swap, (7, 9) no swap | [2, 4, 7, 9] |
The order is 2, 4, 7, 9, which is B, C, A, D.
Option 4: this is the array after only one pass, [2, 7, 4, 9].
Related questions:
2025: 27 May Shift 2
2026: 29 May Shift 2