week1_discussion

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

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

CSE 101 - Discussion Big- O Notation Review

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

View Full Document
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”
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 ).

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

View Full Document
Big- O Rule #1 We can remove all constants from consideration. 4n simpliFes to n n 2 + 10 simpliFes to n 2
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

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

View Full Document
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
O Rule #4 Logarithms are dominated by polynomials (even fractional polynomials). n + (log n)

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

View Full Document
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
Ask a homework question - tutors are online