Bubble Sort Visualizer & Step Calculator
Interactive step-by-step Bubble Sort execution visualizer with comparisons, swaps, and time complexity breakdown.
Bubble Sort
Enter your custom input data → Run the real algorithm engine → Observe step transitions.
⚙️ Customize Algorithm Input Data
Initial unsorted array of 5 elements.
Algorithm state rule requirement
State pointers updated
Mathematical Formula
Overview & Explanation
Bubble Sort is a simple comparison-based sorting algorithm that repeatedly steps through an array, compares adjacent elements, and swaps them if they are in the wrong order.
How It Works
- Iterate through the array from left to right.
- Compare each pair of adjacent elements.
- Swap elements if the left element is greater than the right element.
- Repeat passes until no swaps are required.
Practical Applications
- Educational visualizer for algorithm fundamentals
- Sorting small or nearly-sorted datasets
Bubble Sort Step Derivation
Sorting array [64, 34, 25, 12, 22]
Pass 1
Compare 64 & 34
Pass 2
Compare 64 & 25
Pass 3
Compare 64 & 12
Pass 4
Final Passes
Frequently Asked Questions
What is the time complexity of Bubble Sort?
Is Bubble Sort a stable sorting algorithm?
Related Calculators
Selection Sort Visualizer & Calculator
Step-by-step Selection Sort execution visualizer tracking minimum element indices, swaps, and comparisons.
Insertion Sort Visualizer & Step Generator
Interactive Insertion Sort step generator showing array shifts and key element insertion.
Quick Sort Visualizer & Partition Calculator
Step-by-step Quick Sort partition visualizer demonstrating pivot selection, left/right pointers, and recursion tree.