Time Complexity

Time complexity describes how an algorithm's running time grows as input size grows.
Also known as
runtime complexity

Intuition

It tells you whether the method stays practical as the problem gets bigger.

Technical definition

Time complexity is usually expressed asymptotically with notation such as O(n), O(n log n), or O(n^2).

Example

A quadratic algorithm may become too slow when input size doubles repeatedly.

Common misunderstandings

  • Big-O ignores constants but constants can matter in real systems.
  • Worst-case complexity is not the only useful performance measure.

Need this inside a product?

The studio builds the systems these terms describe. Tell us what you are working on.