Explain Recursion please | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Explain Recursion please

5th Nov 2016, 10:16 AM
Djaber Meghar
Djaber Meghar - avatar
4 Answers
+ 3
Explain xkcd https://www.explainxkcd.com/wiki/index.php/244:_Tabletop_Roleplaying From the link: ...a new game inside the game they're currently playing. "Recursing" refers to "recursion," a concept of computer programming where a piece of code calls itself, essentially making the code run multiple times "within" itself. Looping is a rudimentary form of recursion. Recursion speed can be the same as iteration. Recursive functions are easier to write, understand and maintain than the same algorithms made complex using iteration.
5th Nov 2016, 11:29 AM
Kirk Schafer
Kirk Schafer - avatar
+ 2
Recursion is when a method calls itself inside itself.
5th Nov 2016, 11:00 AM
Harry Pearson
Harry Pearson - avatar
+ 2
recursion is a method in which function call itself. Used mainly when try to find value after a loop has execute like factorial value. It make your function slow, try to avoid if you don't like slow program.
5th Nov 2016, 11:03 AM
Aditya kumar pandey
Aditya kumar pandey - avatar
+ 1
Recursion is a very important idea, but not so complicated, and he is not just a programming technique. In general, a recursive definition consists of two parts. There is at least one base case that directly determines the outcome of a given case, and at least one recursive (inductive) case to determine the results of this case based on the results of other problems, generally a simplified version of the same problem. For example: The factorial function of a natural number may be the simplest recursive definition in the world. A typical induction definition: 1! = 1 (n+1)! = (n+1) * n! The first equation defines the base case. The second equation uses the factorial of the previous number to define the factorial of all natural numbers except the base case.
29th Nov 2016, 7:00 AM
zhanglong
zhanglong - avatar