Asymptotic Notation
- Running time of an algorithm, order of growth.
- Worst case.
- Running time of an algorithm increases with the size of the input in the limit as the size of the input increases without bound.
Big-theta notation (a=b)
- g(n) is an asymptotically tight bound of f(n).
- Asymptotically non negative/positive.
- If g(n) is asymptotically negative then theta(g(n)) = empty.
Example
1/2n2 - 3n= theta(n2).
Big O-notation (a<=b)
- Asymptotic upper bound
- Not tight bound
- Theta is stronger than O
- O notation describe upper bound on every input.
- We also have amortized analysis.[An amortized analysis is any strategy for analyzing a sequence of perations to show that the average cost per operation is small, even though a single operation within the sequence might be expensive]
]
Example
The running time is O(n2) means there is a function f(n) that is O(n2) such that for any value of n, no matter what particular input of size n is chosen, the running time of that input is bounded from above by the value f(n).
Big-Omega notation (a>=b)
- Asymptotic lowerbound
o-Notation
w-notation
Properties:
analogy to comparison of two real numbers, a, b.
Comments
Post a Comment