Skip to content

Latest commit

 

History

History
30 lines (16 loc) · 998 Bytes

chapter1.md

File metadata and controls

30 lines (16 loc) · 998 Bytes

Chapter 1 - algorithms complexity

Two most often considered measurement of algorithms — time complexity and space complexity.

Time complexity

worstO(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:

img

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:

img

Useful links:

wikipedia — Analysis of algorithms