Bugsy
Explains
3 hearts left

Big O

New idea

Same 1,000 items, 1 step or a million

Take an array of 1,000 items. Reading one by its index takes 1 step. Binary search takes about 10. Linear search can take 1,000. Bubble sort takes about 1,000,000. Same items, wildly different amounts of work.

Programmers don't compare code in seconds, because seconds depend on the computer. A fast laptop makes slow code look fine. Instead they count steps, and ask one question. When the number of items grows, how fast do the steps grow?

The answer has a name, Big O. We call the number of items n.