INTERACTIVE COMPUTER SCIENCE · V0.805
Sorting Algorithm Studio
See every comparison and write. Understand the cost. Predict what happens next.
one visual lab
Bubble sort
Make the difference visible.
Compare algorithmic operations, not unreliable device timing. Every row is computed from your exact input.
| Algorithm | Comparisons | Writes | Swaps | Total steps |
|---|
Predict the next write.
Follow the actual algorithm trace, then choose the array after the next data write. No memorized animations.
What happens after the next write?
The algorithm is paused immediately before a write.
CHOOSE THE ARRAY AFTER THE NEXT WRITEFrom the first swap to Big O.
Change the input to nearly sorted, reversed, or full of duplicates. Step through the same data with different algorithms, compare actual operations, and practice predicting the next transformation.
Sorting algorithm FAQ
What do the bar colors mean?
Gold bars are being compared; coral bars were just modified; pale green bars are known to be in final positions. The highlighted indices come from the real algorithm execution trace.
Are these real algorithm implementations?
Yes. Every bar state, step and counter comes from actual sorting operations in the JavaScript implementation, including intermediate array writes during merges and insertions.
Do the counters measure actual performance?
They count comparisons, writes and swaps on the selected input. They do not measure runtime, because device performance and visualization frame rates would distort comparisons.
Does this work without an account?
Yes. It runs in your browser. Lesson progress is saved locally when browser storage is available; it is never sent to a server by this page.