CCA Guide
Time Complexity

Time Complexity

Curated by Last modified: 1 min read

View Markdown

Big O notation describes an asymptotic upper bound on how an algorithm’s work grows with input size . It does not measure an exact number of seconds.

GrowthNotation
Constant
Logarithmic
Linear
Quadratic
Exponential

Binary search repeatedly halves the remaining range in a sorted list. Its worst-case number of iterations grows on the order of .

Review clarification

The original expression describes the growth rate, not the exact integer number of steps for every implementation and input. For example, a standard inclusive-bound search of a nonempty list takes at most iterations.

Related: Arrays · Loops · Recursion

Linked to this page