Question: Use the following recursive function to answer the next three questions: int f(int n){ if(n return 2; else return f(n-1); } Question 44 (1 point)
Use the following recursive function to answer the next three questions:
int f(int n){
if(n
return 2;
else
return f(n-1);
}
Question 44 (1 point)

What values of n will give the base case of the given function?
Question 44 options:
| n = 0 | |
| n = 2 | |
| n = 1 | |
| n = -10 |
Save
Question 45 (1 point)

What is the output of f(3)?
Question 45 options:
| 2 | |
| 4 | |
| 3 | |
| This function does not give an output. |
Question 46 (1 point)

What is the runtime complexity of this function?
Question 46 options:
| O(N) | |
| O(N^2) | |
| O(1) | |
| O(log N) |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
