Question

STATEMENT 3: Algorithm A takes n log, (n) + 10na elementary operations and algorithm B takes 1776 + n log, n. Then for large

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

Statement 3:

In an equation, when n grows larger the lower order terms in the equation have the least effect on the running time of the algorithm.

Even a small fraction of the highest order term is enough to dominate the lower order terms when n is large enough. In general when we calculate algorithms running times we ignore the lower order terms and the coefficient of highest order term as they have a very minimal effect when n is large.

So from the given two equations if we ignore lower order terms and coefficient of the highest order term. So the equations we got

1)n5log3n (We ignored 10n2 as it is a lower order term) (Algorithm A)

2)n6 (We ignored 17 coefficient of n6 and lower order term  n4log7n) (Algorithm B)

We know that logn is faster than n.

We can write above two equations like below

1)n5 * log3n

2) n5 * n

So clearly the first equation i.e. n6 is greater than the second equation i.e. n5log3n and takes more time to run. Therefore Algorithm A is faster than Algorithm B

Add a comment
Know the answer?
Add Answer to:
STATEMENT 3: Algorithm A takes n log, (n) + 10na elementary operations and algorithm B takes...
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