cs lecture nov 11

cs lecture nov 11 - cs lecture nov 11 nov 16 practice exam...

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

View Full Document Right Arrow Icon
cs lecture nov 11 nov 16 – practice exam nov 17 – no class nov 18 – practice exam marking, no tutorial if(s==(char *)0) equal to s==0 equal to ! s. if(t[0]==’\0’) equals to !*t equals to *t==0 time complexity, big-o notation Let f(x) be a function over real numbers. O(f(x)) is a set of functions g(x)€O(f(x)) if and only if there exists M>0 and X_0 st |g(x)<=M|f(x)| for all x>x_0 ex 3x^2 €O(x^2) -> f(x) ^ g(x) proof if x>1, then |x^2 + 2| = 3X^2+2 <= 5x^2 = 5|x^2| Therefore if x_0=1 and M=5, |3x^2+2| <= M |x^2| fpr a ;; x > x_0 6sinx EO(1) proof if x>0 then |6sinx |<=6 = 6 x 1 Pick m=6, prick x_0 = 0 eg g(x) – any polynomial g(x) =a_n x^n + a_n-1 X^n-1 + … a_1 x + a_0 g(x) E O(x^n) proof if x>1 then |g(x)|<=|(a_n+…a_0)x^n| let x_0 = 1 and M = sum a_n then |g(x)| <= M |x^n| as a result if n<=m then x^n EO (x^m) (N>0 and m>0) eg x^4 EO (x^76) log_a x EO (log_b x) Proof: if x > 1 then |log_a (x)| = log_a (x) = 1/log_b (a) |log_b (x)| M=1/log_b (a) ie we can ignore the base of a logarithm
Background image of page 1

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

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

This note was uploaded on 12/10/2011 for the course CS 137 taught by Professor Clarke during the Fall '10 term at Waterloo.

Page1 / 3

cs lecture nov 11 - cs lecture nov 11 nov 16 practice exam...

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

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