10

I just solved a recursion problem without using recursion.
Yes, it's roughly 4 times more code, but at least I understand what the hell is happening.

Comments
  • 6
    Recursion problems are just loops with weird conditions. If it wasn't trivial, you'll be able to cut down on the code with some optimisations.
    No recursion is good eighter way.
  • 0
    Hopefully this was useful to understand recursion
  • 2
    Before you solve the recursion problem you must first solve the recursion problem. Only then, can recursion be solved by recursion.
  • 0
    Recursion: good for searches/traversal of objects with variable depth

    While loop: making sure it won't crash due to stack overflow
Add Comment