lecture18 - Lecture 18 Integers and Division Big Oh...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 18 Integers and Division
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Big Oh Notation If f(x) and g(x) are two functions of a single variable, the statement f(x) is O(g(x)) means that k R , c R , x R , x k 0 f(x)| c g(x)|. After a while (when the input size is larger than k), g(x) becomes larger than f(x) up to a constant c .
Background image of page 2
Recap: Big Oh Think of big-Oh as an upper bound Analogous to ≤ in the asymptotic sense
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Big Omega (n) (n) is used to specify a lower bound on the running time. The algorithm will take at least this much time.
Background image of page 4
Formal Definition of (n) Similar to O(n) with the order of equality reversed If f(x) and g(x) are two functions of a single variable, the statement f(x) (g(x)) means that k R , c R , x R , x k f(x)| c g(x)|. Informally, f(x) is greater than c g(x) for sufficiently large x. Example: f(x) = 8x 3 + 5x 2 + 7 is (x 3 ). since 8x 3 + 5x 2 + 7 > x 3 for all x > 0.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
An example Let f(n) = 1+2+ … +n Show that f(n) is O(n 2 ) Show that f(n) is (n 2 ) For f(n), we have
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 25

lecture18 - Lecture 18 Integers and Division Big Oh...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online