introduction
asymptotic notation
- upper bound: f = O(g)
- lower bound: f = \Omega(g)
- tight bound: f = \Theta(g), g = \Theta(f)
computational complexity
- O(1): constant time (does not
depend on the size of input)
- O(\log n): logarithmic time
- O(n): linear time
- O(n \log n): quasilinear/loglinear
time
- O(n^2): quadratic time
- O(n^c): polynomial time
- O(c^n): exponential time
- O(n!): factorial time
problem types
- decision problem: does the input satisfy some conditions?
- optimization problem: optimal solution for given input
algorithmic domain
(A, f_1, \cdots, f_m, r_1, \cdots,
r_n) where:
- A universum
- f_1, \cdots, f_m function such that
f_i: A^{k_1} \to A
- r_1, \cdots, f_n relations such
that r_j \subset A^{l_j}
We say f is a partial function if
its value is undefined for some elements of A
There are: