Foundations

Concept shape

Start here
0
1
2
3
4
5
Definition

Big O describes how runtime or memory grows as input size grows.

Step 1 / 5
Concept shape
Current lesson

Big O Notation Lab

Foundations Start here

Big O Notation

Welcome to the Big O Notation concept lab. Big O is a vocabulary for describing how work grows as the input gets larger. It does not predict exact milliseconds. It helps you compare shapes of growth, such as one loop over the data, repeated halving, or every item compared with every other item. For beginners, the useful habit is to count what repeats: loops, recursive calls, and extra storage. The must know points are: O(1), O(log n), O(n), O(n log n), O(n^2) are the beginner essentials. Ignore constants when comparing growth. Worst-case reasoning is common in interviews. The common operations are: count loop growth, compare nested loops, estimate memory. The complexity shape is A language for describing complexity. Watch out for these pitfalls: Calling every loop O(n) without checking nesting. Forgetting that recursion can multiply work. Related algorithms include Merge Sort, Binary Search, Bubble Sort.

Concept details

Big O is a vocabulary for describing how work grows as the input gets larger.

It does not predict exact milliseconds. It helps you compare shapes of growth, such as one loop over the data, repeated halving, or every item compared with every other item.

For beginners, the useful habit is to count what repeats: loops, recursive calls, and extra storage.

Must know

  • O(1), O(log n), O(n), O(n log n), O(n^2) are the beginner essentials.
  • Ignore constants when comparing growth.
  • Worst-case reasoning is common in interviews.

Complexity

A language for describing complexity

Open deeper visual structure lesson
1.0x