Algorithms

Spring 2007
course
navigation

feb 1

size of input : - for numbers, number of bits it takes to write it down - but usually just the number of "things" we're given time : - typically number of "basic operations" - usually what people focus on space : - bit harder to quantify exactly - ... and usually there's a time/space trade-off asymptotic behavior is what we usually cae about 1 n log(n) n*log(n) n**2 n**3 2**n n! and in particular: EXPONENTIAL IS BAD. worst-case vs best-case vs average-case O(f(n)) notation : any function that doesn't grow faster than a multiple of f(n) as n gets big
How to do all this for specific cases? There are two general approaches: theory (do the math and prove a result) vs experiment (run your algorithm and see what happens)
One easy way to draw the graphs for the "run it and see" is with gnuplot. Example
http://cs.marlboro.edu/ courses/ spring2007/algorithms/ notes/ feb_1
last modified Thursday February 1 2007 2:08 am EST