Sorting Algorithm Visualizer
Enter a small numeric array, choose an algorithm, and step through the states produced by that implementation in your browser.
Enter values and create a trace.
A QUICK WALKTHROUGH
How to use this tool
- Enter 2–32 finite numbers separated by commas or spaces.
- Choose bubble, insertion, selection, or Lomuto quicksort and create the trace.
- Use the step or play controls to inspect comparisons, swaps, shifts, and writes.
The implemented algorithms
Bubble sort uses adjacent comparisons with early exit; selection sort selects the next minimum; insertion sort shifts a sorted prefix; quicksort uses the last item as a Lomuto partition pivot and an explicit segment stack.
Counts have defined meanings
Comparisons count value-to-value ordering checks. Movements count swaps, shifts, or key writes shown by the trace. Setup assignments and control-flow checks are excluded.
Bounded local visualization
Input is limited to 32 values between −1,000,000 and 1,000,000. Trace generation and playback stay in this page.
GOOD TO KNOW
Common questions
Does quicksort always choose the same pivot?
Yes. This implementation chooses the last value in each segment as the Lomuto pivot.
Is the visualizer a speed benchmark?
No. Playback time is for teaching and does not measure algorithm runtime.