Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions

Question

What qualities do you see as necessary for your line of work?

Answered: 1 week ago