Exam-style question
Try this first
What happens when a recursive function never reaches its base case?.
- A.It continues making recursive calls until the program cannot continue normally
- B.It automatically changes into an iterative algorithm
- C.It returns the base-case value immediately
- D.It skips all the general cases and finishes
Model answer
What a good answer should say
- It continues making recursive calls until the program cannot continue normally
Explanation
Why this works
Without reaching a base case, the recursive calls do not stop. This can cause the program to fail because too many calls are made.
Common mistake
No common mistake is linked to this question yet.
