Easy · O(n²) worst, O(n) best
Bubble Sort quiz
Pick an answer to see whether it's right, and why. Nothing is saved or sent.
Question 1 of 10
- Question 1: current
- Question 2: not answered yet
- Question 3: not answered yet
- Question 4: not answered yet
- Question 5: not answered yet
- Question 6: not answered yet
- Question 7: not answered yet
- Question 8: not answered yet
- Question 9: not answered yet
- Question 10: not answered yet
Bubble sort runs one pass over [5, 2, 8, 1, 7, 3, 6, 4]. What does the array look like after it?
Take it further
- AnimationSorting
Bubble Sort Animation
The interactive version of the short video: bars that cross when they swap, a sorted tail that grows, and the early exit
Free
