Lec0209 - CS 173 Discrete Mathematical Structures Cinda Heeren heeren@cs.uiuc.edu Rm 2213 Siebel Center Office Hours W 9:30-11:30a Cs173 Spring

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

View Full Document Right Arrow Icon
CS 173: Discrete Mathematical Structures Cinda Heeren heeren@cs.uiuc.edu Rm 2213 Siebel Center Office Hours: W 9:30-11:30a
Background image of page 1

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

View Full DocumentRight Arrow Icon
Cs173 - Spring 2004
Background image of page 2
Cs173 - Spring 2004 CS 173 Announcements Homework 4 available.  Due 02/12, 8a. Midterm 1:  2/23/06, 7-9p, location SC 1404.  Send me an email  asap if you have a conflict.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Cs173 - Spring 2004 CS 173 Growth of functions Algorithm “Good Morning” For I = 1 to n    For J = I+1 to n       ShakeHands(student(I), student(J)) Running time of “Good Morning” Time = (# of HS) x (time/HS) + some overhead We want an expression for T(n), running time of “Good Morning” on input of size n.
Background image of page 4
Cs173 - Spring 2004 CS 173 Growth of functions Algorithm “Good Morning” For I = 1 to n    For J = I+1 to n       ShakeHands(student(I), student(J)) How many handshakes? 1 2 3 4 5 n 1 2 3 4 5 I J n 2 - n 2
Background image of page 5

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

View Full DocumentRight Arrow Icon
Cs173 - Spring 2004 CS 173 Growth of functions Algorithm “Good Morning” For I = 1 to n    For J = I+1 to n       ShakeHands(student(I), student(J)) T(n) = s(n 2 - n)/2 + t Where s is time for one HS, and t is time for getting  organized. = O(n 2 ) if ShakeHands() runs in constant  time.
Background image of page 6
Cs173 - Spring 2004 CS 173 Growth of functions Algorithm analysis is concerned with: Type of function that describes run time (we ignore  constant factors since different machines have different  speed/cycle) Large values of 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
Cs173 - Spring 2004 CS173 Growth of functions Guidelines: In general, only the largest term in a sum matters.  a 0 x n  + a 1 x n-1  + … + a n-1 x 1  + a n x = O(x n ) n dominates lg n.
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/15/2008 for the course CS 173 taught by Professor Fleck@shaffer during the Spring '08 term at University of Illinois at Urbana–Champaign.

Page1 / 26

Lec0209 - CS 173 Discrete Mathematical Structures Cinda Heeren heeren@cs.uiuc.edu Rm 2213 Siebel Center Office Hours W 9:30-11:30a Cs173 Spring

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

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