Recursion Question

I have a problem with recursion. I am disecting Binary Search Trees (Binary Search, AVL, AA, and RedBlack) to gather statistical information about the trees. However I am hitting a "Exception in thread "main" java.lang.StackOverflowError" due to the levels of recursion. However, I must recuse beyond the point in order to gather my statistics. How can I recurse beyond this point?

[388 byte] By [DavidPulliama] at [2007-10-2 4:09:37]
# 1
Are you sure you are running into an actual recusion limit or is there a problem with your algorithm? I must confess I have not tried to attack a deep b-tree, but all (100%) of my stack overflow issues were due to a programming but on my part.- Saish
Saisha at 2007-7-15 23:32:47 > top of Java-index,Java Essentials,Java Programming...
# 2
When I read "recursion" and "stack overflow" in one sentence, I immediatelystart thinking: "coding error". Recursion can be tricky sometimes, especiallyif you don't have the sentinel conditions right. Can you show us some code?kind regards,Jos
JosAHa at 2007-7-15 23:32:47 > top of Java-index,Java Essentials,Java Programming...
# 3
Think about tail recursions, does fun things with the generated bytecode.
salpetera at 2007-7-15 23:32:47 > top of Java-index,Java Essentials,Java Programming...
# 4

I figured out what was happening.The person who authored the code did not tell me they were using non-standard practices. Rather than using a null link (this was involveing a search tree) the person actually used a nullnode class and the javadoc did not explain this. So I would recurse till the stack overflowed. Once I found this out, it was easy to repair.

DavidPulliama at 2007-7-15 23:32:47 > top of Java-index,Java Essentials,Java Programming...
# 5
> How can> I recurse beyond this point?Simple. Just extend the stack by giving a command to the JVM (which I have forgotten).
..u..j....a at 2007-7-15 23:32:47 > top of Java-index,Java Essentials,Java Programming...