This is interesting you say this (and very timely), because in a C++
data structures course I'm taking, we're creating recursive box trace
diagrams. Even in tail-recursive functions, we draw it such that the
stack keeps on growing. So I'm curious if we draw it this way because:

1. you can never count on compilers besides Scheme being
tail-recursive, or
2. the professor is just trying to make it simpler for all the
students.


Gene wrote:
> There is a lot of work on this in the literature on functional
> languages, where rewriting recursions can lead to aymptotic speedups.
> Often the idea is to get from a general recursion to tail recursion in
> order to avoid stack growth and value copying.

Reply via email to