University of Washington • CSE583 • D. Notkin © 2000
35
Recursion vs. iteration
lThese are comparable control structures
–One or the other is needed for a language to be Turing-complete
–Recursion is in some sense more general, since it has an implicit stack
lRecursion is often considered less efficient (time and space) than iteration
–Procedures calls and stack allocation or deallocation on each “iteration” (recursive call)