Computer Science
Basic

Quadratic Time

Runtime that grows with the square of input size.

Formula

O(n2)O(n^2)

Variables

nInput size

Example

Bubble sort

Did You Know?

Quadratic algorithms crawl on big data: sorting a million items the naive way takes a trillion comparisons.