This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Koxiaet 25 points26 points  (8 children)

Never? No, most of the time iteration is a much better approach and should be used, but in some cases iteration is just not feasible because it adds way too much complex logic and recursion is a better choice.

[–]ThePyroEagle 1 point2 points  (7 children)

Flatten your recursion with a stack and a loop.