Question: 3 . Find the close form complexity function of T ( n ) = 3 T ( n - 1 ) + 1 , while

3. Find the close form complexity function of T(n)=3T(n-1)+1,
while T(1)=1(10 points)
4. Suppose you have two different algorithms with the following running times to solve
the same problem. (10 points)
For algorithm1: T(n)=(104)n +100
For algorithm2: T(n)=2(n2)+20n +100
When will algorithm1 outperform algorithm2 and vice versa? Explain your answer.
5. For the following pseudo-code, what is the time complexity function T(n)
and the order (O)? You can ignore the overhead operations and just count the
basic operations. (30 points)
for (i=1; i<=n; i++)
for (j=1; j<=3*i; j++)
for (k=1; k<=3*n; k++)
cout <<"*" ;

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 Databases Questions!