Question: Why is it important for a recursive function to have a base case? To ensure the function can access global variables To prevent the function
Why is it important for a recursive function to have a base case?
To ensure the function can access global variables
To prevent the function from modifying external variables
To prevent the function from calling itself indefinitely, leading to a stack overflow
To increase the execution time of the function
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
