Computational Complexity Analysis

Complexity Analysis

Key Concepts

Big-O Notation

Complexities ordered from smallest to largest

Complexity Notation
Constant Time O(1)
Logarithmic Time O(log(n))
Linear Time O(n)
Linearithmic Time O(nlog(n))
Quadratic Time O(n^2)
Cubic Time O(n^3)
Exponential Time O(b^n), b > 1
Factorial Time O(n!)

Properties of Big-O

  1. O(n + c) = O(n)
  2. O(nc) = O(n), c> 0