How many lines, as a function of n (in (.) form), does the following program print?
Fantastic news! We've Found the answer you've been seeking!
Question:
How many lines, as a function of n (in Θ (.) form), does the following program print?
Write a recurrence and solve it.(Average case)
function f(n):
res=0
if n ≤ 1:
res 1
else:
for i in range (n):
res += f(i) * f(n – i – 1)
print (res)
return res
Related Book For
Mathematical Applications for the Management Life and Social Sciences
ISBN: 978-1305108042
11th edition
Authors: Ronald J. Harshbarger, James J. Reynolds
Posted Date: