Functional Problem Solving (CSC 151 2014F) : Outlines

Outline 26: Recursion with Helper Procedures


Held: Monday, 13 October 2014

Back to Outline 25 - Recursion Basics, Continued. On to Outline 27 - Recursion with Helper Procedures, Continued.

Summary

We consider a different form of recursion, one based on the construction of recursive helpers that take additional parameters. Along the way, we consider the idea of tail recursion. We also explore how careless design of recursive procedures can inadvertently lead to slow execution.

Related Pages

Overview

Administrivia

Upcoming Work

Extra Credit Opportunities

Academic

Peer Support

Basics of Helper Recursion

Tail Recursion

Old Notes

These are from a previous time I taught the class. I leave them around for historical reasons.

Delayed Evalution in Recursive Procedures

Helper Recursion

  partial-sum            unexplored-elements
  0                      (2 3 5 7 11 13)
  2                      (3 5 7 11 13)
  5                      (5 7 11 13)
  8                      (7 11 13)
  15                     (11 13)
  26                     (13)
  39                     ()