1
vote
5answers
476 views

What are the advantages of recursion compared to iteration? [duplicate]

I'm trying to understand when is preferred to use recursion rather than iteration. Actually I've encountered recursion only in Javascript but never in Python. I imagine that recursion should be used ...
8
votes
10answers
3k views

In term of performance : while , for … Loops VS recursion

What is better for performance to write the loop as linear e.g. for , while or write it as recursion ?