Hi. Just discovered this website. Nice work putting all this together.
I wanted to comment on the StackOverflowError section on the Common Errors page. I think you should mention here, and on your Recursive Algorithms page, that it is a good practice to limit the number of recursions a method can make.
public class MyRecursionClass {
private static final int MAX_RECURSIONS= 1000; // or whatever limit works for you
private int numRecursions;
private void startRecursion(SomeObject so) {
numRecursions = 0;
recursiveMethod(so);
}
private void recursiveMethod(SomeObject so) {
if (++numRecursion > MAX_RECURSIONS) {
return;
} else {
// process SomeObject here...
// recurse
recursiveMethod(so);
}
}
Regards,
Michael