0
When do i need recursion in a ruby application?
2 Answers
+ 5
Bear in mind, though, that recursion is memory-hungry, as it stores every recursion step until the very last moment when the final step - the base case - is reached and the "folding" begins.
When you reach the memory limit while carrying out a recursive procedure, all is lost and you have pretty much reached the ceiling, as there is little you can do to overcome this, aside from rewriting the code :)