How to understand recursion function easily? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to understand recursion function easily?

not able to understand recursion chapter,when a question is asked I don't have any idea how to apply recursive method in a program.Otherwise iterations are really easier than recursion method.

20th Feb 2018, 7:49 AM
Aditya Sahu
Aditya Sahu - avatar
3 Answers
20th Feb 2018, 8:12 AM
Hannah Grace
Hannah Grace - avatar
+ 12
Recursion is a function that call itself until a condition is reached. Think that you have 2 mirror and then you put one faced to the other. The first will reflect whatever is in the second and the second will do the same. So the image will reflect again and again and again but just by using these 2 mirrors. So the same happens with recursion. You just use one function to do the same thing a lot of times by just calling itself. Hope this example help you!! :DD
20th Feb 2018, 8:07 AM
Alex Shaw 😻
Alex Shaw 😻 - avatar