r/programming • u/SilasX • May 09 '15
"Real programmers can do these problems easily"; author posts invalid solution to #4
https://blog.svpino.com/2015/05/08/solution-to-problem-4
3.1k
Upvotes
r/programming • u/SilasX • May 09 '15
1
u/dccorona May 09 '15
Recursion is often just a useful tool for figuring out the algorithm...when you break it up like that, it becomes easier to wrap your head around for most people.
Once you've got it figured out, you actually write a solution that replaces the recursion part with something else, be it an optimization that changes the algorithm entirely, or just using an internal stack to simulate the recursion without the overhead (or causing a stack overflow)