Two most often considered measurement of algorithms — time complexity and space complexity.
worst – O(f(n))
, read as big-o, the most widely used
medium – Θ(fn(n))
, read as big-theta
best – Ω(f(n))
, read as big-omega, rarely used in practice
For example: O(lg(n))
Comparation of time complexities:
Approximations are used much more often than exact measurements.
For example, these two functions are treated as equal O(n^2)
== O(25.7 * n^10)
.
Hidden constant – is all hidden values inside O(...)
.
Comparation of time complexity functions: