Question: ( 1 0 ) Consider the following two algorithms A and B . For A ( n ) , let its time be tA (

(10) Consider the following two algorithms A and B. For A(n), let its time be tA(n). Give a recurrence for
tA(n)(dont forget the initial condition) and solve it. For B(n), let its time be tB(n). What is tB(n) and why?
Correct solution to incorrect recurrence will get little credit.
A(x, n)
if n =0
return x*x
else
return x*x*x*A(x, n-1)
end A
B(n)
for i=1 to n
for j=1 to i
print A(n, n*n)
print A(n, n*n)
end B

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!