warming up your workspace

Time complexity

Applies to: general

Time complexity describes how an algorithm's running time grows with the input size, expressed in Big-O. It lets you compare algorithms independently of hardware: an O(n) solution eventually beats an O(n^2) one regardless of constants.

linear scan: O(n)    nested loops: O(n^2)    binary search: O(log n)

See also: big-o, space-complexity