Skip to content
CodeItRaw
Code Reading
/
Branching Calls
Path
Play
Daily
Leaderboard
tr
Read the Big-O
Branching Calls
Every call makes two more calls and nothing is remembered. How does the time grow with n?
1
def
fib
(n):
2
if
n <
2
:
3
return
n
4
return
fib(n -
1
) + fib(n -
2
)