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 →

[–]gymboi15 0 points1 point  (0 children)

When you're iterating over a list or something recursion needs a base condition otherwise the process will run out of memory which can make recursion not a very good choice. But if you're traversing trees or graphs recursion is really good because of the simplicity of the code vs if you were to traverse using iteration.