AlgorithmGrows likeComparisonsSince n ÷ 2

Every count is measured: the algorithms really run on random numbers on this page. The searches look for a number that is not in the list, which is the worst case for both.

Comparisons as n grows

A faster computer, or a better algorithm?

Watch these step by step: binary search and bubble sort and other sorting algorithms.

AI-generated interactive demo.