Question 16
CODE
Consider the function:
int f(int n) {
if (n <= 0) return 1;
return f(n - 1) + f(n - 1);
}
What is the time complexity of f(n)?Detailed Solution
Each call splits into 2 recursive calls, forming a full binary tree of height n with $2^n$ nodes.
✓ Saved