Suppose we have a version of quick sort which selects pivots using the median-of-three strategy and creates
Fantastic news! We've Found the answer you've been seeking!
Question:
Suppose we have a version of quick sort which selects pivots using the median-of-three strategy and creates partitions in the manner described in lecture. Explain how you would build an input array that would cause this version of quick sort to run in O (n 2 ) time. Your answer should explain on a high level what your array would look like and what happens when you try running quick sort on it. You do not need to give a specific example of such a array, though you may if you think it will help make your explanation more clear.
Related Book For
Mathematical Statistics with Applications in R
ISBN: 978-0124171138
2nd edition
Authors: Chris P. Tsokos, K.M. Ramachandran
Posted Date: