week1_discussion

week1_discussion - CSE 101 Discussion Big-O Notation Review...

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

View Full Document Right Arrow Icon
CSE 101 - Discussion Big- O Notation Review
Background image of page 1

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

View Full DocumentRight Arrow Icon
Why Use Big- O ? Simplify efFciency comparisons Quickly identify inefFciency (e.g. 2 n ) Considers the worst-case scenarios A statement about the “upper-bound”
Background image of page 2
Big- O Defnition Given Functions f(n) and g(n) , f(n) is O(g(n)) when there exists some constant c > 0 such that f(n) <= c * g(n) For all n >= n 0 . The value oF c must be a constant! It cannot be related to n (i.e. a Fraction or multiple oF n ).
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- O Rule #1 We can remove all constants from consideration. 4n simpliFes to n n 2 + 10 simpliFes to n 2
Background image of page 4
Big- O Rule #2 We can remove all lower order terms from consideration. n 3 + 1000n 2 + 50n simpliFes to n 3 1000n 3 + 5n simpliFes to n 3
Background image of page 5

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

View Full DocumentRight Arrow Icon
Big- O Rule #3 Polynomial terms are dominated by exponential terms. 2 n + n 1000 simplifes to 2 n 3 n + 2 n simplifes to 3 n
Background image of page 6
O Rule #4 Logarithms are dominated by polynomials (even fractional polynomials). n + (log n)
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/20/2012 for the course ECE 101 taught by Professor Siegel during the Spring '08 term at UCSD.

Page1 / 18

week1_discussion - CSE 101 Discussion Big-O Notation Review...

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

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