Which property is shown by the above function calls?
Memoization
Optimal substructure
Overlapping subproblems
Greedy
View Answer
Correct Answer: C — Overlapping subproblems
Explanation:
From the function calls, we can see that fibonacci(4) is calculated twice and fibonacci(3) is calculated thrice. Thus, the same subproblem is solved many times and hence the function calls show the overlapping subproblems property.
