road-to-software-engineering

Mostly fun stuff


Project maintained by theo-pnv Hosted on GitHub Pages — Theme by mattgraham

Algorithm complexity

Ordered from best to worse:

  1. Constant (1)
  2. Logarithmic (log(n))
  3. Linear (n)
  4. N-Log-N (n log(n))
  5. Quadratic (n²)
  6. Exponential (2^n)
  7. Factorial (!n)

  f(n) is O(g(n)) g(n) is O(f(n))
g(n) grows more YES NO
f(n) grows more NO YES

Ressources