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
Answer and explanation
Concise answer
To stop further recursive calls
Why this is correct
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.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
