Recursion Flashcards

1
Q

Creating a recursive function can be accomplished in two steps

A

Write the base case – Every recursive function must have a case that returns a value without performing a recursive call. That case is called the base case.
A programmer may write that part of the function first, and then test. There may be multiple base cases.

Write the recursive case – The programmer then adds the recursive case to the function.

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