Iterative vs. Recursive coding
Neil Cerutti
neilc at norwich.edu
Fri Aug 20 13:09:43 EDT 2010
On 2010-08-20, John Nagle <nagle at animats.com> wrote:
> Python does not do tail recursion, so using recursion where
> iteration could do the job is generally a bad idea. Scheme, on
> the other hand, always does tail recursion where possible.
A tail-recursive function is usually easy to convert to a
loop-style iteration. However, Scheme does tail-call
optimization, I believe, which is slightly more general.
--
Neil Cerutti
More information about the Python-list
mailing list