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?
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 >

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 >

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.