Scheme · Lesson 7

Recursion and tail calls

Write recursive procedures with a base case and a smaller step, walk lists with car and cdr, and use accumulators so tail calls run in constant space.

Lessons · Scheme · Lesson 7 of 10

Recursion and tail calls

Write recursive procedures with a base case and a smaller step, walk lists with car and cdr, and use accumulators so tail calls run in constant space.

Illustration for Scheme
Write recursive procedures with a base case and a smaller step, walk lists with car and cdr, and use accumulators so tail calls run in constant space.