Recursion Flashcards

1
Q

What is recursion

A

Recursion is basically a function calling itself to a smaller subset of the problem until the entire problem is solved.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the required components in a recursive function

A
  1. Base case when the recursion will end.
  2. A recursive function must take parameter to allow it to only resolve a smaller problem.
  3. It has to combine the result of the previous call to the current call.
  4. Return the final answer of the function call.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly