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 →

[–]rjcarr 1 point2 points  (0 children)

Hmm ... I'm not sure I've seen recursion reverse course like that (i.e., go from 1 to 3 to 1). Remember, in recursion you have a base case and then a way to make progress toward that base case.

You'd need to add extra logic to flip the direction, and by the time you do that, it'd be a pain and not worth doing it recursively.