Hello this is #Mastery21 about using recursion in algorithms. A recursion refers to the action of when a function calls itself. It is kind of like creating a loop.
Why? Calling the function inside the function creates a series of events which lead to the result that is the same using a lop with while or for.
- In recursion, a function calls itself but you shouldn’t assume these two functions are same function.
- Local variables are defined inside a function and has scope only inside that function. In recursion, a function call itself.
Recursion makes it easier to express ideas in which the result of the recursive needs to complete the task.
WATCH MY VIDEO https:/ / youtu.be/ i9wo3N8tNzk
#Mastery21 – Use of recursion for repetitive algorithms by Ricardo Newton is licensed under a Creative Commons Attribution 4.0 International License.