Note: use the github provided TOC for navigaing.
Recursion is a technique where we devide a bigger problem into a smaller instance of the same problem, and solve the smaller problems to solve the bigger problem.
e.g. say you want the sum of all the elemnts of an array. For that you can also use recursion. Here you will devide the array into smaller parts and do summation operation on the smaller chunk till you get the total sum.
Always keep in mind that, a problem that can be solved using recursion also can be solved iteratively.
factorial(N) = N * factorial(N-1)
. here we can devide the bigger problem into a same problem but for smaller input size.