Question: The QuickFind algorithm. The input is an array A [ 1 : n ] of distinct numbers and an integer k , 1 < =
The QuickFind algorithm. The input is an array A : n of distinct numbers and an integer k k n The task is to find the kth smallest number in A Recursive subproblems concern subarrays Ai : j and one is seeking the hth smallest item in Ai : j The initial call is to QuickFindA n k If i j the algorithm simply returns Ai Otherwise it applies the Partition algorithm from Quicksort, and either returns the pivot item if it is the hth smallest item, or recurses on the left subarray if it contains at least h items ie if h j i and otherwise recurses on the right subarray but with h replaced by h l i the reduction in the size of the subproblem
Pseudocode follows.
procedure QuickFindA i j h
Finds the kth smallest item in Ai : j if j i then return Ai
else
PartitionA i j l;
l in the index of the pivot location after the partition completes if hlithenreturnAl
else
if h l i QuickFind A l j h l i end if
end if end if
end procedure
Given this algorithm, I am looking to solve this problem:
Recall the QuickFind algorithm from homework Show that with probability at least n it takes time Omega n log n log log n
Hint. Suppose you are seeking the smallest item, and also that each of the first log n log log n partitions is among the top log log n log n fraction of the remaining items.
What is the minimum size of the resulting subproblem after log n log log n iterations? ie you need to show a bound b such that the resulting subproblem has size at least b
Give a lower bound on the probability of this event.
Give a lower bound on the runtime to reach this point.
You may assume xx e for x
Also, it may be helpful to recall that log n log log n
Finally, note that it suffices to show a lower bound for all n n where n is a suitable constant.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
