Question

For [Select], there are three choices: worse than, the same as, better thanAnswer the following questions about the computational properties of divide-and-conquer sorting algorithms, based on tight bi

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

1. Quick Sort partitions the array based on the value of the pivot element. Hence, for partition to take place, it need to place the elements in the correct position with respect to the pivot. Hence, the "divide" part is the place where the main partitioning happens in case of quick Sort.
Merge Sort ,on the other hand, simply divides the array into two equal halves recursively. The4 main sorting part of the algorithm comes afterwards. So, divide part of quick sort is slower than that of merge sort.

Answer: worse than

2. As was discussed in the previous question, divide part of quick sort takes more time than merge sort. However, for merge sort, the main computation occurs after partition. Hence, the Running time for the "conquer" part of quick sort is faster thant that of merge sort.

Answer: better than

3. Worst case Running time of General implementation of Quick Sort is O(n2). Worst case Running time of Merge Sort is O(nlog(n)). Hence, merge sort is quicker.

Answer: worse than

4. For the average case, both quick and merge sort have equal compexities ( O(log(n)) ). Hence, they will take the same time.

Answer: the same as

5. General implementation of merge sort requires extra space to store the left and right subarrays during merging. However, the quick sort algorithm takes no extra space as it can be done inspace. Hence, merge sort has higher space complexity.

Answer: better than

Do give a thumbs up if you are satisfied with this answer to help me out. Thanks! :)

Add a comment
Know the answer?
Add Answer to:
For [Select], there are three choices: worse than, the same as, better than Answer the following...
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