Exam-style question
Try this first
What is the main purpose of a base case in a recursive algorithm?.
- A.To stop further recursive calls
- B.To make every recursive call use a different variable type
- C.To ensure the algorithm always repeats forever
- D.To replace the need for any general case
Model answer
What a good answer should say
- To stop further recursive calls
Explanation
Why this works
The base case is the condition that is solved directly. When it is reached, the algorithm does not make another recursive call, so the recursion can finish.
Common mistake
No common mistake is linked to this question yet.
