What is the minimum requirement for a recursive function to terminate successfully? 

  • It must have an iterative loop. 
  • It must have a base case. 
  • It should call other functions. 
  • It should be complex in nature.
For a recursive function to successfully terminate, it must have a base case. A base case is a condition under which the function stops calling itself and starts returning values. Without a base case, a recursive function would call itself indefinitely, leading to an infinite loop and, in most cases, a stack overflow error.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *