Skip to main content
2 of 2
edited tags
Raphael
  • 73.4k
  • 31
  • 184
  • 406

Recursion: base case vs. small version

I'm reviewing the definition of recursion and in my notes are two questions about a recursive problem. One question asks about the base case, the other one about the small version of the problem, I always get confused about which is which... can you help me to find a way to better understand these concepts?

The examples in the exercise are:

  • a function that determines if there is a "x" element in an array
  • a function that determines if the string is palindrome or not

for both:

  1. Find the base case
  2. Find the small version of the problem
  3. (Implement the recursive solution)