Question
Suppose company X has created 3 new variants of quick sort but, because they are unsure which is asymptotically best, they have hired you to
Suppose company X has created 3 new variants of quick sort but, because they are unsure which is asymptotically best, they have hired you to analyze their runtimes. Compute the asymptotic runtimes of the variants and use this to justify which is best:
? Variant 1: Partitioning the array still takes ?(n) time but the array will always be divided into (at least) a 10% and 90% portion.
? Variant 2: Partitioning the array now takes ?(n 1.1 ) time but the array will always be divided perfectly in half.
? Variant 3: Partitioning the array now only takes ?(?n) time but all of the numbers except the pivot will be partitioned into a single array.
Hint: It may help to know for all c > O.
(n/) and that logn o(n) =1
Step by Step Solution
3.41 Rating (160 Votes )
There are 3 Steps involved in it
Step: 1
The asymptotic runtimes of the given three variants are as follows For the 1 st Variant Explanation ...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