logo

Crowdly

Is the following function tail-recursive? def fib (n: int) -> int: if n ==...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Is the following function tail-recursive?

def fib (n: int) -> int:

if n == 0:

return 0

elif n == 1:

return 1

else:

return fib(n - 1) + fib(n - 2)

More questions like this

Want instant access to all verified answers on learning.monash.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!