Question

) Arrange the running time of functions mentioned below by the order (increasing) of their growth....

) Arrange the running time of functions mentioned below by the order (increasing) of their growth.

n^3 , n, nlog(n) , log(n), 2^n, n^2, n!

my guess without doing the math is:

n

nlog(n)

log(n)

n^2

n^3

2^n

n!

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

The best way to answer this question would be taking 2-3 test cases, having n greater than, say, 20

-----------------------------

So, for n = 20

-----------------------------

n^3 = 8000

n = 20

nlog(n) = 59.915

log(n) = 2.996

2^n = 1048576

n ^ 2 = 400

n! = 2.4329 x 10^18

---------------------------------

So as per the observation, the ascending order is,

log(n)

n

nlog(n)

n^2

n^3

2^n

n!

NOTE:- Order may vary as per extreme values, but this will be valid for majority of the numbers to a great extent

Add a comment
Know the answer?
Add Answer to:
) Arrange the running time of functions mentioned below by the order (increasing) of their growth....
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