Ad
  • Custom User Avatar

    Note on recursion is IMO not necessary. I think it's your task to know when recursion is a good tool, and when it's not. If you decide to use it, you should already know (or find out) if it's applicable to your problem, in your language, etc.

    Recursion, just like every other tool, has its advantages and disadvantages. Here, the latter outweigh the former. You just picked the wrong tool for the job.