I’m trying to solve the problem of “count ways to reach the nth step in a staircase” with recursion. When given a number of stairs to climb, I have to calculate the number of ways to climb taking either 1 or 2 steps at a time. For example, if there are 4 stairs, we would return 5 since we would
Tag: stack-overflow
StackOverflowError on recursive algorithm
I’m trying to code a recursive algorithm in order to generate a valid board(unique solution) for a game called kakuro. When executing the program I keep getting a StackOverflowError. I tried debugging …
StackOverflowError when serializing an object in Java
I am writing an application in Java using Swing. I am trying to implement functionality to save and load simulation states for at simulation i am running. The entire simulation is kept as an object, disconnected from Swing. I am trying to serialize my Simulation class with this code: But i get the following error (it is huge). Can anybody