Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We are trying to optimise the pivot section of the Quicksort algorithm. For our pivot choice, we are using an algorithm to find the median
We are trying to optimise the pivot section of the Quicksort algorithm. For our pivot choice, we are using an algorithm to find the median of an unsorted list. The algorithm we opt to use for this takes On time, where n is the size of the list we are partitioning. This would make the overall worstcase time complexity of Quicksort as Onlogn Why don't we use this approach in general?
Question Answer
a
While the linear overhead of finding the median is not visible in the asymptotic description, we assume it to be too large to be practical
b
This is a better approach and we should use it
c
We would have to sort the list before we can calculate the median
d
There's no algorithm to calculate the median in On time
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