Question
You are picking between mergesort and quicksort in order to sort a large array of integers which will generally be randomly distributed. Your solution will
You are picking between mergesort and quicksort in order to sort a large array of integers which will generally be randomly distributed. Your solution will be deployed in a low-cost embedded system for which cost of memory is relevant. Choose the best statement below:
a. Quicksort has worst case O(n2) performance, but this is rare for randomly distributed numbers. For randomly distributed numbers quicksort generally has O(n log n) performance.
b. Quicksort is a better choice in this application because it does not require extra memory, whereas mergesort does.
c. Both of these statements are true.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started