I've been doing some past papers for my ComSci course and I've ran into a bit of trouble understanding this question:
"Define a recursive relationship that expresses the number of calls involved in using the below function to find the nth Fibonacci number.: "
def f(n):
if n == 1 or n == 2:
return 1
else:
return f(n - 1) + f(n - 2)
I understand how the function works f(1), f(2) requires 1 call f(3) requires 3, f(4) requires 5 etc... However, I'm at a loss as to how to approach this question.
Thanks for reading :)