Skip to content

What Is Big-O?

Lesson 1 of 5 · 4 min

What Is Big-O?

Step 1 of 7

Big-O plots work against input size — never seconds, never hardware.

The Idea

Big-O describes how an algorithm's work grows as its input grows. It deliberately ignores hardware, language, and constant factors. What's left is the shape of the growth curve, and that shape is the only thing that survives when data gets big.

Real-World Example

Airport security is a fair comparison. Adding one more traveller barely changes the wait, but doubling the crowd roughly doubles it. The number on the clock matters far less than that relationship.

The Code

Your turn

What does this print?

nums = [4, 8, 15]
steps = 0
for x in nums:
  steps += 1
print(steps)

Mini quiz

1 / 3

What does Big-O mainly describe?