RECURSION
What is Recursion?
Recursion is the process of defining a problem (or the solution to a problem) in terms of (a simpler version of) itself.
A Recursive Function like the one in the picture is a function that calls itself. Recursive functions are very useful to solve many mathematical problems, such as calculating the factorial of a number, generating Fibonacci series, etc. But while using recursion, programmers need to be careful to define an exit condition from the function, otherwise it will go into an infinite loop.
Below you will find a cartoon dialog that ilustrates how the recursive function works:
If you still don't understand the concept this video may help you:
Hope you learn how to use recursion and take advantage of it as it helps you optimize code.