CSC151 2009F, Class 39: Analyzing Procedures Admin: * Don't forget to turn in your pretty picture of cons trees * Reading for tomorrow: Testing Your Procedures. * Are there questions on Assignment 7? * I'll do a short demo of an interesting outcome of yesterday's lab. * Rights and the environment symposium this week * EC for attending * EC for attending Fetish, since one of your colleagues is running it. Overview: * Comparing algorithms. * Two related metrics: Time and Number of steps. * Counting procedure calls by printing. * Tools for analysis. Observation: There is more than one way to write a procedure that gives a desired result * Approximately a dozen strategies for rgb-darkest * As long as they are all correct, which is "best"? * The most concise (define rgb-darkest (lambda (colors) (fold rgb-darker colors))) * The most efficient * The fewest recursive calls * The most stable * Least likely to give an error message on correct input * The most readable * Easiest to determine, for a particular audience, what it does * Given two algorithms to solve the same problem, how do you determine which is the most efficient? * Mathematically: Form a hypothesis about the running time and prove it * MAT 218 teaches you how to solve recurrence relations * Scientifically: FOrm a hypothesis and gather data about how long the procedure takes to run * Today's idea: TOols help us count