Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Note: when a problem has an array of real numbers, you cannot use counting sort or radix sort. 1 Picking Quicksort pivot Consider the cheating

image text in transcribed
Note: when a problem has an array of real numbers, you cannot use counting sort or radix sort. 1 Picking Quicksort pivot Consider the "cheating" version of Quicksort where we keep picking a pivot until we find one that is in the "middle haf" of the array that is one that results in a partition where the smaler side has at least n/4 items. The probability of finding such a pivot is 1/2. Thus the expected number of times we have to pick a pivot until we find an acceptable one is 2. Suppose that we revise our pivot picking strategy as follows: pick 3 numbers from the array uniformly (with replacement), sort the 3 numbers and use the middle of the 3 as the pivot. What is the probability that our chosen pivot ite is i the "middle half" What is the expected number of times that we have to pick a pivot in this manner until we find one that is in the "middle half"? Show your work

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications Dexa 2023 Workshops 34th International Conference Dexa 2023 Penang Malaysia August 28 30 2023 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Maqbool Khan

1st Edition

ISBN: 303139688X, 978-3031396885

More Books

Students also viewed these Databases questions