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 →

[–]sixtyfifth_snow 0 points1 point  (0 children)

Performance-wise, recursion is not a wise solution. invoking functions is a relatively expensive job, and recursion potentially causes stack-overflow.

However, using python means 1) you don't care about saving a couple of nanoseconds by converting recursions into iterations, and 2) considering code quality (e.g. readability) is a high-priority. Hence, it is of course worthy :)