Skip to content

Big-O Notation

High School

Definition

Big-O notation expresses algorithm complexity as growth rate relative to input size. Represents worst case.

Formulas

O(1) < O(log n) < O(n) < O(nlog n) < O(n²) < O(2ⁿ) < O(n!)

Complexity order

f(n) = O(g(n)) ⇔ ∃ c, n₀: f(n) ≤ c · g(n), ∀ n > n₀

Big-O definition

Examples

Example 1

Complexity of finding value in array?

Example 2

Big-O of 3n² + 5n + 1?

Applications

Algorithm Design

Choosing efficient algorithms

Interviews

Essential coding interview knowledge

System Design

Scalability analysis

Related Documents

Was this page helpful?