Pass 1 of
? | Comparing index
0 & 1
š Bubble Sort Algorithm
Repeatedly step through the list, compare adjacent elements, and swap
if in wrong order.
- Compare arr[i] with arr[i+1]
- If arr[i] > arr[i+1], swap them (bigger "bubbles up")
- After each pass, the largest unsorted element is in place
- Time: O(n²) | Space: O(1)