def a(n):
if n == 0:
return 0
else:
return n*a(n - 1)
def b(n, tot):
if n == 0:
return tot
else:
return b(n-2, tot-2)
a) Both a() and b() aren’t tail recursive
b) Both a() and b() are tail recursive
c) b() is tail recursive but a() isn’t
d) a() is tail recursive but b() isn’t
Observe the following Python code?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Observe the following Python code?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!