Tail recursion to while iteration in 2 easy steps

Ravi Sahni ganeshsahni07 at gmail.com
Thu Oct 3 13:27:48 EDT 2013


On Wed, Oct 2, 2013 at 10:46 AM, rusi wrote:
> 4. There is a whole spectrum of such optimizaitons --
> 4a eg a single-call structural recursion example, does not need to push return address on the stack. It only needs to store the recursion depth:
>
> If zero jump to outside return add; if > 0 jump to internal return address
>
> 4b An example like quicksort in which one call is a tail call can be optimized with your optimization and the other, inner one with 4a above

I am interested in studying more this 'whole spectrum of optimizations'
Any further pointers?

Thanks

-- 
Ravi



More information about the Python-list mailing list