Question

3.22 Can the average case cost for an algorithm be worse than the worst case cost? Can it be better than the best case cost?

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

The worst case cost for an algorithm is calculated by taking the input on which the algorithm performs the worst . It represents the worst case scenario for the algorithm.

The best case cost for an algorithm is calculated by taking the input on which the algorithm performs the best . It represents the best case scenario for the algorithm.

Average case cost for any algorithm is calculated by making all inputs equally likely. So the probability that the algorithm will get the best possible input or worst possible input or any other input are all equally likely.

So in the worst scenario, average case cost can be as bad as worst case but not worse and can be as good as best case but not better.

So the answer for both the question is No.

Add a comment
Know the answer?
Add Answer to:
3.22 Can the average case cost for an algorithm be worse than the worst case cost?...
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