# Big O Notation

> How fast an algorithm's work grows when its input grows.

**Field:** Software Development  
**Category:** Algorithms & Data Structures  
**Also known as:** Big O, Big-O, O(n), Asymptotic Notation

## Think of it like

Think of it like a walk. If the road gets twice as long, how much longer is the walk?

## Definition

Big O notation describes how the work an algorithm does grows as its input grows. O(1) means the work stays the same, however big the input. O(n) means the work grows in step with the input. O(n²) means doubling the input makes four times the work. It ignores small details and shows the shape of the growth.

## Example

Lucy's search checks every name, which is O(n). For 1,000,000 names it may take 1,000,000 checks; a binary search needs about 20.

## Why it matters

It lets you compare algorithms before you write them. A bad growth shape hurts more as data gets bigger.

## Common mistake

Reading Big O as an exact speed. It only says how the work grows; a slow O(n) can beat a fast O(n²) on tiny inputs.

## Three principles

- **Growth, not speed.** How work rises with size.
- **Common shapes.** O(1), O(log n), O(n), O(n²).
- **Worst case usually.** Unless it says otherwise.

## Related terms

- [Time Complexity](https://learn.benibix.com/term/development/time-complexity)
- [Space Complexity](https://learn.benibix.com/term/development/space-complexity)
- [Algorithm](https://learn.benibix.com/term/development/algorithm)
- [Binary Search](https://learn.benibix.com/term/development/binary-search)
- [Best, Worst and Average Case](https://learn.benibix.com/term/development/best-worst-average-case)

---

Source: https://learn.benibix.com/term/development/big-o-notation
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
