Course · Section 11: Working With Arrays · Lecture 172: Sorting Arrays
Implement `bubbleSort(arr)` that returns a new-or-in-place array sorted in ascending order using bubble sort.
+ 1 hidden test run on Submit.
Bubble sort makes repeated passes swapping neighbors. O(n^2) time, O(1) extra space.
Run your code to see results.