Question

Outline a scenario where you would use a specific type of algorithm. Could other algorithms be...

Outline a scenario where you would use a specific type of algorithm. Could other algorithms be used? If so, why should they not be used? Defend why your choice of algorithm would be used compared to others.

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

Suppose we have an array of integers and we want to sort them either in ascending or descending order. For sorting the integers I will use Merge Sort Algorithm.

Yes other algorithms like Bubble Sort, Quick Sort, Selection Sort, Insertion Sort, etc. can also be used for sorting the integers.

They should not be used because their worst case time complexity is O(n2), where n is the number of integers to be sorted.

Merge Sort should be used because its time complexity is O(nlogn), where n is the number of integers to be sorted. This means merge sort take less time to sort the integers as compared to other sorting algorithms and hence saves time. And in this fast world nothing is more important then time. So Merge sort should be used to sort the integers.

If the answer helped please upvote. It means a lot. For any query comment below.

Add a comment
Know the answer?
Add Answer to:
Outline a scenario where you would use a specific type of algorithm. Could other algorithms be...
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