0

When do i need recursion in a ruby application?

5th Dec 2017, 7:30 PM
Chouchan Abdou
Chouchan Abdou - avatar
1 Odpowiedź
+ 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 :)
5th Dec 2017, 8:23 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar