MYSIMULATOR
INTERACTIVE SCIENCE STUDIO / 2D
Algorithms / Experiment 09

Sorting Algorithm Race

Put bubble sort and insertion sort head-to-head on the exact same shuffled array.

← All experiments
LIVE VISUALISATIONLIVE MODEL
SIMULATION / 09 ●
Adjust parameters to restart the model
—
—
—
—
—
—

What you are exploring

Bubble sort repeatedly swaps adjacent out-of-order values; insertion sort shifts values into a sorted prefix. Both are O(n²) in the worst case, but their actual operation counts differ.

Made with 🤖 ChatGPT