Open emmcold opened 6 years ago
Q. How will you explain recursion to a kid? A. Ask a kid to climb to the staircase until you say stop. This stop keyword is the base case of recursion. While coming down or going up ask the child to count the number of the stairs. This is the activity which one performs in the recursive code. The child ends up in the starting position since he/she has to come down. This shows that the stack in recursion is cleared once the function call is ends.
This is a very well compiled list about recursion!! Kudos 👍 Good Job 🥇
Whenever revising recursion remember to answer these questions:
Typical problems of recursion: