Midterm Review
Tyler Moore
CSE 3353, SMU, Dallas, TX
, 2013
Portions of these slides have been adapted from the slides written by Prof. Steven Skiena at SUNY Stony Brook, author
- f Algorithm Design Manual. For more information see http://www.cs.sunysb.edu/~skiena/
Administrivia
Extra office hours next week
Monday 12:30pm-1:30pm Monday 5-5:30pm You may pick up graded HW2 and answer key then
Midterm next Tuesday March 5
You may use one side of 1/2 sheet of letter paper for handwritten notes No calculators Review today
2 / 34
Defining bounding functions
f (n) = O(g(n)) means c · g(n) is an upper bound on f (n). Thus there exists some constant c such that f (n) is always ≤ c · g(n) for n ≥ no for some constant n0. f (n) = Ω(g(n)) means c · g(n) is a lower bound on f (n). Thus there exists some constant c such that f (n) is always ≥ c · g(n) for n ≥ no. for some constant n0. f (n) = Θ(g(n)) means c1 · g(n) is an upper bound on f (n) and c2 · g(n) is a lower bound on f (n). Thus there exists some constant c1 and c2 such that f (n) ≤ c1 · g(n) and f (n) ≥ c2 · g(n) for n ≥ no for some constant n0.
3 / 34
Dominance and little oh
We say that f (n) dominates g(n) if limn→∞
g(n) f (n) = 0. Otherwise f (n)
does not dominate g(n). We say that f (n) = o(g(n)) ⇐ ⇒ g(n) dominates f (n) So n2 = o(n3) since n3 dominates n2.
4 / 34