O -Notation. April 23, 2003 Prepared by Doug Hogan CSE 260. O -notation: The Idea. Big-O notation is a way of ranking about how much time it takes for an algorithm to execute How many operations will be done when the program is executed?
April 23, 2003
Prepared by Doug Hogan
After x0, |f(x)| ≤ M ∙ |g(x)|
Before x0, nothing claimed about f’s growth
such that for all x in the domain of f and g, |f(x)| ≤ M ∙ |g(x)| when x > x0
17x6 – 3x3 + 2x + 8 is O(x6); M = 30; x0 = 1
17x6 – 3x3 + 2x + 8
M = 45; x0 = 6
f(x) = 7x3 - 2x + 3
M = 12, x0 = 1 7x3 - 2x + 3 is O(x3)
xr is O(xs)
anxn+an-1xn-1 +… + a1x + a0is O(xm) for all m ≥ n
such that |x2| ≤ M ∙ |x| for all x > x0 (1)
anxn+an-1xn-1 +… + a1x + a0is NOTO(xm) for all m<n
Let f and g be functions and k be a constant.
Let f and g be functions and a,b,m,n be constants.
Epp, Susanna. Discrete Mathematics with Applications. 2nd Ed. Belmont, CA: Brooks, 1995.
Headington, Mark A., and David Riley. Data Abstraction and Structures using C++. Lexington, MA: Heath, 1994.