Question

Let T(n) represent the total execution time of a loop for which the loop test is...

Let T(n) represent the total execution time of a loop for which the loop test is true n times (i.e., the loop body will execute n times). For each possible value of T(n) listed below, give a tight upper bound for the time cost (in terms of O(…)) of one execution of the loop body (denote this by L(n)) that makes the statement true. Answer each part separately. Each answer should be of the form L(n) = O(…)

a. T(n) = O(n2 )

b. T(n) = O(n)

c. T(n) = O (n lg n)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Since the loop will be true n times

So, the net complexity will become n times too

So,

A)

L(n)=O(n^3)

B)

L(n)=O(n^2)

C)

L(n)=O(n^2*log(n))

Add a comment
Know the answer?
Add Answer to:
Let T(n) represent the total execution time of a loop for which the loop test is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT