dsa2 - Sheet1 Page 1 Intro to Algorithms 1 Big Oh Big Omega...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: Sheet1 Page 1 Intro to Algorithms 9/2/10 1. Big Oh, Big Omega, and Big Theta Notation 2/ Examples 3. Algorithm Analysis 4. Multiplication, division, modular addition, euclidean algorithm Big O Defn: f(n)=O(g(n)) if f(n)<=c*g(n) for some c and for n>=n0 Big O is the upperbound of algorithms Big Omega Notation. f(n)=Omega(g(n)) if g(n)=O(f(n)) Omega is for the lowerbound of algorithms For some constant c and for all n>=n0 Big Theta noation f(n)=Theta(g(n)) if f(n)=O(g(n)) and g(n)=O(f(n)) eg. n^2=O(n^2) f(n)=n^2 g(n)=g(n^2) n^2<=cn^2 c=2 n^2=O(n^3) n^2<=cn^3 for n>=n for some constant c lim f(n)/g(n) n->inf nlog(n)=O(n^2) lim nlog(n)/n^2=lim log(n)/n=0 n->inf lim n->inf 2^n=O(n^2) Take Logarithms nlog(2)?2logn log(n)<n<nlog(n)<n^2<n^3..n^k...2^n...n^n n!=O(g(n)) f(n)=n! g(n)=n^n n!=n*n-1*n-2... n!<n*n*n*n n!<n^n g(n)=2^n Sheet1 Page 2 n!=O(2^n) n!<c*2^n for all n n sigma i = O(n) i=1 n sigma i=1+2+3+...+n i=1 <n+n+n.......
View Full Document

This note was uploaded on 09/20/2011 for the course ECON 1110 taught by Professor Person during the Spring '11 term at Rensselaer Polytechnic Institute.

Page1 / 5

dsa2 - Sheet1 Page 1 Intro to Algorithms 1 Big Oh Big Omega...

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

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