The number of passes required by the bubble sort algorithm to sort 'n' elements in the list are________ .
The number of passes required by the bubble sort algorithm to sort 'n' elements in the list are________ .
Solution
✅ Correct Option: 1
In each pass of bubble sort, the largest unsorted element moves to its correct position at the end of the list. After passes, elements are in place, so the remaining one must be in place too.
So elements need passes.
Option 2: is the time complexity (roughly the number of comparisons), not the number of passes.
Total comparisons in the worst case:
Pass count and comparison count are different things: passes , comparisons .
Related questions:
2026: 23 May Shift 1
2026: 11 May Shift 2
2026: 24 May Shift 1
2025: 3 June Shift 2