Lecture Notes for CS 512, Algorithm Design
30 September 1999
These are provisional lecture notes, expect changes.
- how to characterize an algorithm's behavior?
- how to compare two algorithms?
- measure them
- good - definitive
- bad - extra work, non-portable, detailed, requires implementation,
compaisons hard
- need a more abstract estimator
- asymptotic or big-oh notation
- presents approximate behavior, ignoring details - constants represent
details
- behaviors as functions of input size, other details abstracted away.
- examine what happens as n grows large, that is, approaches infinity
asymptotically
- input usually characterized as worst case - best case too unrealistic
and average case usually too difficult to characterize.
- order notation
- big omicron
- characterizes an upper bound
- g is O(f) if there exists constants c and N
such that for all n > N, g(n) <= cf(n)
- because constants don't matter, use simplest functions;
O(n), not O(2n)
- monotonic functions; exponentials grow faster than polynomials;
n grows faster than log n
- addition and multiplication of functions
- tight and loose (upper) bounds
- big omega
- characterizes the - not a - lower bound
- g is O(f) if there exists constants c and N
such that for all n > N, g(n) => cf(n)
- lower bounds are hard, because they range over all solutions
- big theta
- tight bounds
- f(n) bounded above and below by g(n)
- little omicron and omega
- strict bounds, non-tight bounds
- keep your eye on the constants
- time and space complexity
This page last modified on 13 October 1999.