I am working on an algorithm problem. I need to traverse a tree with 30000 nodes in pre-order.
With my experiments, I found when the recursion level is bigger than 10000, it will result in stack overflow. We know non-recursion version of pre-order traversing of a general tree is not that easy to implement, so I am trying to make the stack size bigger.
Since it is an online judge, I can't configure the stack size directly. I know there is a way to write some #prgram instructions in C++ to change the stack size, so I want to if there exists something similar to that in Scala.