21.2k views
4 votes
A function is called from the main function and then it calls itself five times. The depth of recursion is

User Sagnalrac
by
7.1k points

1 Answer

3 votes

Answer: five.

Step-by-step explanation: The depth of a recursion or Recursive statement can simply be explained as the maximum number of times a function calls itself until the stopping condition is met. In the scenario above, the number of times the function calls itself is five hence the depth of recursion will be five. A Recursive function or algorithm involves repetitive calling of itself( that is the Recursive function) until the condition to stop is met, hence the number of times the fuction has to call itself before the stopping condition is satisfied is called the depth of the Recursive algorithm.

User Dondon Jie
by
7.8k points