|
|
Recursion versus iteration |
Recursive functions are - modulo use of memory resources - sufficient for any iterative need Tail recursive functions in Scheme are memory efficient for programming of any iterative process |
|
A tail call is the last 'thing' to be done before the function returns. Therefore there is no
need to maintain any activation record of such a call - we can reuse the previous activation record.
The image series below will illustrate this.
|
|
|
|