Question: ( 2 0 points ) We explore a different analysis of the application of random - ized quicksort to an array of size n .

(20 points) We explore a different analysis of the application of random-
ized quicksort to an array of size n.
(a)(2 points) For iin[1,n], let xi be the indicator random variable for
the event that the i th smallest number in the array is chosen as the
pivot. That is,xi=1 if this event happens, and xi=0 otherwise.
Derive E[xi].
(b)(2 points) Let T(n) be a random variable that denotes the running
time of randomized quicksort on an array of size n. Prove that
E[T(n)]=E[i=1nxi*(T(i-1)+T(n-i)+(n))]
(c)(2 points) Prove that E[T(n)]=2n*i=2n-1E[T(i)]+(n).
(d)(7 points) Prove that k=2n-1klogk12n2logn-18n2.(Hint: Consider
k=2,3,dots,(n2)-1 and k=n2,dots,n-1 separately.)
(e)(7 points) Use (d) to show that the recurrence in (c) yields E[T(n)]=
(nlogn).(Hint: Use substitution to show that E[T(n)]cnlogn
for some positive constant c when n is sufficiently large.)
( 2 0 points ) We explore a different analysis of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!