try to imagine what linearizing and short circuiting could achieve.
Hm. Seeing's believing :) But I'm not really sure what you mean by "linearizing" in this context?
If you mean brute-forcing the recursion to iteration using manual stack handling, that often works out more costly than the recusion it is trying to eliminate.
If the recursion can be eliminated through tail-recursion, that's very effective in languages that support it. (Properly; goto \&recurse is usually slower).
But I'm pretty sure this can't be written to be tail-recursive.
|