Chapter 13: Problem 5
What is direct recursion? What is indirect recursion?
Short Answer
Expert verified
Direct recursion is defined as a function that calls itself directly within its body, such as the factorial function. Indirect recursion occurs when a function calls another function, and that second function calls the first function, creating a recursive loop between the two functions, as seen in the calculation of the nth number in the Fibonacci sequence using two functions, fibonacci_even and fibonacci_odd.