Question DSA-CX-0062
HardWhat is the time complexity of this code?
def f(n):
if n <= 1:
return 1
return f(n - 1) + f(n - 2)
- A.
O(2ⁿ) exactly, and no tighter
- B.
O(n log n)
- C.
Sign up free to see the answer and a step-by-step explanation.