Too many calls

Consider the following recursive function:

1
2
3
4
5
def fun(n):
    if n < 1:
        return
    fun(n-1)
    fun(n-3)

If fun(8) is called how many times will the fun() function be invoked (including the call fun(8)) ?

×

Problem Loading...

Note Loading...

Set Loading...