Naive recursive Fibonacci <code>fib(n) = fib(n-1) + fib(n-2)</code> has time complexity
- Acheck_circle
O(2ⁿ)
- B
O(n²)
- C
O(log n)
- D
O(n)
Explanation
Branching tree; exponential without memoization.
AP Computer Science A· difficulty 4/5
Naive recursive Fibonacci <code>fib(n) = fib(n-1) + fib(n-2)</code> has time complexity
O(2ⁿ)
O(n²)
O(log n)
O(n)
Explanation
Branching tree; exponential without memoization.
Want 10 more like this — adaptive to your weak spots?