← All lessons
Computer Science5 min read

Big-O in five minutes

How to judge whether an algorithm will survive real data.

Big-O describes growth, not speed. It answers: if the input gets 10× bigger, how much more work happens?

O(1) is constant — a dictionary lookup. O(log n) halves the problem each step, like binary search. O(n) touches everything once. O(n²) compares every pair, which collapses fast past a few thousand items.

When code feels slow, don't micro-optimise first. Find the loop inside a loop and remove a whole order of growth.

Keep going

Test yourself with a quiz, or browse the STEM Hub for experiments on this topic.