Compare algorithms
Run several algorithms on the same input, side by side, and see where each one wins.
0 / 429 steps
What the comparison shows
Quadratic sorts such as bubble, insertion and selection sort make about n²/2 comparisons on random data, while merge sort, quicksort and heapsort stay close to n log₂ n. The shape of the input changes the picture: insertion sort needs little more than n comparisons on nearly sorted data, while quicksort depends on how evenly its pivots split the values.