Question: Consider the following implementation of Randomized Quick sort RANDOMIZED-PARTITION(A. PO 1 - RANDOM, 2 exchange Alrl with all 3 return PARTITION(A.P.D RANDOMIZED-OUICKSORTIA.p.) 1 itp 2
Consider the following implementation of Randomized Quick sort RANDOMIZED-PARTITION(A. PO 1 - RANDOM, 2 exchange Alrl with all 3 return PARTITION(A.P.D RANDOMIZED-OUICKSORTIA.p.) 1 itp 2 q - RANDOMIZED-PARTITIONA, p.) RANDOMIZED-QUICKSORTIA p.9-1) RANDOMIZED-OUICKSORTIA G-21) 3 4 Assume that p = 5 and = 10. what is the probability that Afp) and Ar will be compared with one another? Select one 21/3 ba C.1/5 d 1/4 What is the average case time complexity of randomized quicksort? Select one a Ollogn) ob 0(1) c. 0(1) . donlog) () What is the probability that the rightmost element becomes the pivot in a single call of RANDOMIZED-PARTITION? Select one: a 1 1 b c. 1 d. 1/2 1 -P
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
