University of Washington • CSE583 • D. Notkin
©
2000
36
Tail recursion (reprieve)
l
In many cases, though, recursion
can be compiled into code that’s as
efficient as iteration
l
This is always possible in the face of
tail recursion, where the recursive
call is the last operation before
returning