There are many problems requiring deep recursion. Usually it's graph problems with big limitations which are solved by DFS. But deep recursion requires large stack size, often several megabytes.
In C++ or Pascal/Delphi the stack size can be set by compiler directives. But it's impossible in Java. The default Java thread stack size is quite small, it's 320kb in 32-bit Windows. The most simple solution is to use -Xss command line switch. But this is where problems begin.
In C++ or Pascal/Delphi the stack size can be set by compiler directives. But it's impossible in Java. The default Java thread stack size is quite small, it's 320kb in 32-bit Windows. The most simple solution is to use -Xss command line switch. But this is where problems begin.