Question

4. In your own words, describe some shortcuts that could allow you to conclude quickly that the O-notation for O(18 n log2 n

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

Solution: Whenever the complexity function of any code is given in such a way that is actually is a linear combination of multiple functions then you are supposed to look at that part of the complexity function that has the highest influence over the graph of the complexity function as a whole. In this case, the complexity of the code is given as O(18nlogn + 19n +3). Let us assume that the complexity function F is actually a linear combination of three functions and they are f1 = nlogn, f2 = n, f3 = C. Now, you are supposed to find the overall effect of each of these functions over the graph of function F. C is for constant and all other constants have been removed as they do not contribute much in effecting the graph of the complexity function. You are supposed to find the most powerful component(function) present in the complexity function because complexity function can be represented in terms of that particular component(function).

f1 is most powerful among all of them as it will affect the graph of the complexity function F the most.

f2 is less powerful as it is responsible for the linearity of the graph only.

f3 is the least powerful as it is constant.

From the above discussion, it can be concluded that function f1 affects the graph of the complexity function the most. Therefore, the complexity function can be explained in terms of function f1 only. That is why O(18nlogn + 19n +3) \approx O(nlogn).

Here's the solution to your question. Thanks for asking and happy learning!!

Add a comment
Know the answer?
Add Answer to:
4. In your own words, describe some shortcuts that could allow you to conclude quickly that...
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