Back to All Algorithms
Bubble Sort
Category: Sorting | Time: O(n^2) | Space: O(1)
Visualization
Visual representation of the data structure
Enter an algorithm and input to start visualization.
About Bubble Sort

A simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.

Code Editor
The code is for reference. Editing it won't affect the visualization.
1
2
3
4
5
6
7
8
9
10
11
12
13
Frequently Asked Questions
About Bubble Sort