What is the primary difference between direct and indirect recursion? 

  • Direct calls itself, while indirect calls another function that calls it back. 
  • Direct uses less memory than indirect. 
  • Direct is slower than indirect. 
  • Direct is always safer than indirect.
Direct recursion occurs when a function calls itself directly, whereas indirect recursion involves a function calling another function that eventually calls the original function. It's a cycle of calling between two or more functions.
Add your answer
Loading...

Leave a comment

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