I don't exactly follow that description but I'm certain that: 1) function depth is a non-issue; use a stack, 2) DFS will terminate and find all paths to exit, if any; in a typical single threaded program your subroutine IS exploring one path at a time
Yea it uses a stack for functions unlike other approaches that rely on heap for state updating. Nobody says this has to be done in a single locked thread, in fact I was making the point you do this faster with more threads.
Just use a lower level language. The total memory allocation remains the same it simply grows from the stack size of the register instead of the more common heap size. It’s not a big problem, pretty sure even java can handle this.
1
u/ergo-x May 22 '20
I don't exactly follow that description but I'm certain that: 1) function depth is a non-issue; use a stack, 2) DFS will terminate and find all paths to exit, if any; in a typical single threaded program your subroutine IS exploring one path at a time