CSC 151 - Analyzing procedures
At this point in your career, you know the basic tools to build algorithms, including conditionals, recursion, variables, and subroutines (procedures). You’ve also found that you can often write several procedures that all solve the same problem and even produce the same results. How do you then decide which one to use? There are many criteria we use. One important one is readability - can we easily understand the way the algorithm works? A more readable algorithm is also easier to correct if we ever notice an error or to modify if we want to expand its capabilities. However, most programmers care as much or more about efficiency—how many computing resources does the algorithm use? (Pointy-haired bosses care even more about such things.) Resources include memory and processing time. Most analyses of efficiency focus on running time, the amount of time the program takes to run. Running time, in turn depends on both how many steps the procedure executes and how long each step takes. Sinc
CSC 151 - Analyzing procedures Analyzing procedures Due Monday, 8 December 2025 --> Summary Once you develop procedures, it becomes useful to have some sense as to how efficient the procedure is. For example, when working with a list of values, some procedures take a constant number of steps (e.g., car ), some take a number of steps proportional to the length of the list (e.g., finding the last element in the list), some take a number of steps proportional to the square of the length of the list (e.g., finding the closest pair of colors in a list). In this reading, we consider ways in which yo
Explore this link on the map →saved by
related reading
- CSC 151 - Tail Recursioneikmeier.sites.grinnell.edu
- CSC 151 - Higher-order design, recursive and othereikmeier.sites.grinnell.edu
- CSC 151 - Coding Challenge 6eikmeier.sites.grinnell.edu
- CSC 151 - The "big three" list operationseikmeier.sites.grinnell.edu
- CSC 151 - Recursion Over Listseikmeier.sites.grinnell.edu
- CSC 151 - Coding Challenge 8eikmeier.sites.grinnell.edu
- CSC 151 - Coding Challenge 1eikmeier.sites.grinnell.edu
- CSC 151 - Recursion over Numberseikmeier.sites.grinnell.edu
- CSC 151 - Coding Challenge 7eikmeier.sites.grinnell.edu
- CSC 151 - Decompositioneikmeier.sites.grinnell.edu
- CSC 151 - Naming values with local bindingseikmeier.sites.grinnell.edu
- Structure and Interpretation of Computer Programsmitp-content-server.mit.edu