Consider the Python code
def f(a,b):
if (a==0):
return b
if (a%2==1):
return 2*f((a-1)/2,b)
return b+f(a-1,b)
print(f(15,10))
The value printed is .
Source: GATE DA
Programming · Python, C & Pseudocode · Problem 6
Consider the Python code
def f(a,b):
if (a==0):
return b
if (a%2==1):
return 2*f((a-1)/2,b)
return b+f(a-1,b)
print(f(15,10))
The value printed is .
Source: GATE DA
Free. Sign in with Google to read Srijit's solutions and talk the problems through with everyone in the cohort.