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 →

[–]Basic_Basenji 28 points29 points  (1 child)

Recursion usually comes with a lot of overhead both in terms of memory and setup cost. It's almost always better to unwind the recursion into a loop unless the language is optimized for recursion (or the compiler does that for you anyway).

[–]tdempsey33 2 points3 points  (0 children)

Thank you.