Suppose company X has created 3 new variants of quick sort but, because they are unsure which
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 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.
Management Science The Art of Modeling with Spreadsheets
ISBN: 978-1118582695
4th edition
Authors: Stephen G. Powell, Kenneth R. Baker