COMPUTER SCIENCE / INTERACTIVE LAB
EXPERIMENT 18 / 20Sorting Algorithm Step Race
Compare bubble, insertion and selection sorting one comparison at a time.
SIMULATING
All three start with the same shuffled values.
Measure 1—
Measure 2—
Measure 3—
Science behind the simulation
Sorting algorithms rearrange data by repeated comparisons and swaps. Bubble sort pushes larger items right, insertion sort inserts into a growing sorted prefix, and selection sort repeatedly selects a minimum. Their work varies with disorder.