asked 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

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.

answered
User Dondon Jie
by
8.2k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.