Question

For an O(Nk ) algorithm, where k is a positive integer, an instance of size M...

For an O(Nk ) algorithm, where k is a positive integer, an instance of size M takes 32 seconds to run. Suppose you run an instance of size 2M and find that it takes 512 seconds to run. What is the value of k?

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

So changing the size from M to 2M or in other words, doubling the size, makes the time increase by 512/32 = 16 times

Which means it increases by a factor of 2^4, So K value is equal to 4.

Hence algorithm complexity is O(N^4), which means on doubling the size, time increases by 2^4 times.

Add a comment
Know the answer?
Add Answer to:
For an O(Nk ) algorithm, where k is a positive integer, an instance of size M...
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