Skip to main content
Question Protected by gnat
Post Closed as "Duplicate" by gnat, pdr, Bart van Ingen Schenau, CommunityBot, Caleb

When should I use What are the advantages of recursion rather thancompared to iteration?

I'm trying to understand when is preferred to use recursion rather than iteration. 

Actually I've encounterencountered recursion only in Javascript but never in Python. I imagine that recursion should be used in determinate contexts or languages but I don't understand when I should use it and which advantages it gives me?.

I would like to see some examples of advantageous usage of recursion, as opposed to iteration.

When should I use recursion rather than iteration?

I'm trying to understand when is preferred to use recursion rather than iteration. Actually I've encounter recursion only in Javascript but never in Python I imagine that recursion should be used in determinate contexts or languages but I don't understand when I should use it and which advantages it gives me? I would like to see some examples of advantageous usage of recursion.

What are the advantages of recursion compared to iteration?

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 in determinate contexts or languages but I don't understand when I should use it and which advantages it gives me.

I would like to see some examples of advantageous usage of recursion, as opposed to iteration.

Tweeted twitter.com/#!/StackProgrammer/status/452628344501436416
Source Link
G M
  • 273
  • 3
  • 10

When should I use recursion rather than iteration?

I'm trying to understand when is preferred to use recursion rather than iteration. Actually I've encounter recursion only in Javascript but never in Python I imagine that recursion should be used in determinate contexts or languages but I don't understand when I should use it and which advantages it gives me? I would like to see some examples of advantageous usage of recursion.