Suppose that a recursive function with integer parameter n has a base case of 0, and for each non-base case, the function makes a recursive call with argument n+1. If the function is initially called with an actual argument of n = 3, the function call will
A) cause an infinite chain of recursive calls.
B) return after a chain of 2 recursive calls.
C) return after a chain of 3 recursive calls.
D) return after a chain of 4 recursive calls.
E) None of the above
Correct Answer:
Verified
Q7: The base case of a recursive function
A)
Q8: The _ of recursion is the number
Q9: Recursion can be used to
A) compute factorials.
B)
Q10: The QuickSort algorithm was developed in 1960
Q11: The speed and amount of memory available
Q13: The _ algorithm uses recursion to sort
Q14: Indirect recursion means that a function calls
Q15: A recursive function cannot call a function
Q16: The quicksort algorithm works on the basis
Q17: Recursive algorithms tend to be less efficient
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents