DSA Visualizer
Sorting algorithms, step by step
Three simple sorts, the same array. Compare how many comparisons and swaps each one takes, and what a "pass" actually looks like.
Repeatedly swaps adjacent out-of-order pairs. Simple, rarely used in practice, but the clearest introduction to how a sort actually moves values.
42
17
8
63
29
4
51
36
Step 1 of 50
Starting array. Bubble sort repeatedly steps through the array, swapping adjacent elements that are out of order.
Put this into practice
Connect the idea to a worked lesson, a practical task or your interview preparation.
- Concept guideSorting Algorithms →Putting a collection into order, and the real cost differences between the ways to do it.
- Practice problemTop Three Scores →Solve this medium problem with samples, hints and checks in your browser.
- LessonPython Lists →Learn how Python lists store ordered, changeable collections of values, and how to create, access, modify, and iterate over them.
- Interview prepCoding & DSA interview questions →The concepts behind data-structure and algorithm interview questions — paired with the practice problems that let you actually write the code.
Last updated: