Ques 1 Recursion
Which of the following is true about recursion?
a) recursive function must call itself two or three times.
b) recursive function not have a base condition.
c) Queue are used to analyse the recursion.
d) All of the above.
Ques 2 Recursion
What is the output of the following Python Code?
def fun(a,b): if a==0: return 0 elif a%2!=0: return fun(a//2, 2*b)+b else: return fun(a//2, 2*b)-b def main(): print(fun(15,5)) main()
Ques 3 Recursion
What is the output of the following Python Code?
def fun(a): if a<=1: print(a,end="") else: fun(a//2) print(a%2,end="") fun(120)