[Index of Lectures]

[ L01 L02 L03 L04 L05 L06 L07 L08 L09 L10 L11 L12 L13 L14 L15 L16 L17 L18 L19 L20 L21 L22 L23 ]

Lecture 18—Accumulators

Before Lecture

There is no pre-work for this lecture. Use this time to review the concepts we have covered previously.

During Lecture

The starters for this lecture are:

After Lecture

Today we introduced accumulators. Accumulators are used in recursive functions to accumulate information from prior recursive calls. While all accumulators have this basic functionality, it is also useful to think of accumulators as falling into one of three categories:

In lecture we did one example of using a single accumulator when traversing a list and one of using two accumulators while traversing a tree.

As always, review the lecture by practicing what we did in class. You can also use the videos from the Accumulators module up to but not including Tail Recursion.

The solutions for this lecture are:

Be sure to complete the before lecture section of Lecture 19 before that lecture.