Bubble Sort Visualization
Visualize the exact C algorithm for bubble sort step by step. See how each iteration compares and swaps elements.
Control Panel
Enter numbers between 0 and 100
Visualization
0
Current Step
0
Total Steps
0
Swaps
0
Comparisons
Enter numbers (0-100) and click "Start Sorting"
Algorithm Logic
Click "Start Sorting" to begin the visualization. The algorithm will compare adjacent elements and swap them if they are in the wrong order.
About Bubble Sort Algorithm
Your C Algorithm
This visualization uses the exact bubble sort algorithm from your C code. The algorithm uses a do-while loop with a flag variable to detect if any swaps occurred in the last pass.
Time Complexity
O(n²)
Worst Case
O(n²)
Average Case
O(n)
Best Case
Space Complexity
Bubble sort is an in-place sorting algorithm, meaning it requires only a constant amount O(1) of additional memory space.

