Lecture overview -- Keyboard shortcut: 'u'  Previous page: Recursion -- Keyboard shortcut: 'p'  Next page: Tail Calls -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Recursion and Higher-order Functions - slide 3 : 35

Recursion versus iteration

Recursive functions are sufficient - but typically memory inefficient - for programming of an iterative process.

Tail recursive functions in Scheme are memory efficient for programming of any iterative process.

Tail recursion is a variant of recursion in which the recursive call takes place without contextual, surrounding calculations in the recursive function.

In a tail recursion function the recursive call is a tail call (see next slide)

Navigate to image series
A recursive formulation of the function fak and the accompanying recursive process
Navigate to image series
A tail recursive formulation of the function fak and the accompanying iterative process without memory optimization
Navigate to image series
A tail recursive formulation of the function fak and the accompanying, memory optimized iterative process