in reply to Re^13: Finding All Paths From a Graph From a Given Source and End Node
in thread Finding All Paths From a Graph From a Given Source and End Node
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^15: Finding All Paths From a Graph From a Given Source and End Node
by LanX (Saint) on Nov 02, 2010 at 20:39 UTC | |
by BrowserUk (Patriarch) on Nov 02, 2010 at 21:14 UTC |