MYSIMULATOR
INTERACTIVE 2D LAB← All simulations

COMPUTATIONAL COMPLEXITY · Algorithms

Sorting Race: Three Algorithms Compared

Race bubble sort, insertion sort and selection sort on the same scrambled data.

REAL SIMULATION ENGINE3 LIVE PARAMETERSWORKS OFFLINE
MYSIMULATOR / LIVE ENGINESIMULATION LIVE
ADJUST PARAMETERS · OBSERVE THE RESPONSE

THE SCIENCE BEHIND THE SCENE

How it works

Different algorithms make different comparisons and swaps to order a list. Bubble sort repeatedly swaps neighbours, insertion sort places each value into a sorted prefix, and selection sort searches for each next minimum. All three have O(n²) worst-case work.

Made with 🤖 ChatGPT