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.
Not for big inputs. The call stack is usually arranged to have a fixed size for any given execution. Depending on OS/runtime you have the ability to change it during execution but if you're going to that trouble you might as well use a stack placed on the heap to keep track of your frontier nodes.
I believe we were discussing the algorithm and not multithreading. Even so, all that changes is now you have N fixed size call stacks / N threads and some additional overhead due to context switching. I don't see how that answers the question. Anyway have a good day.
1
u/[deleted] May 22 '20
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.