Question: 1. (15) (a) In the lineartime selection algorithm discussed in class, suppose that we rst divide the input into groups of 5 elements. After medians

1. (15) (a) In the lineartime selection algorithm discussed in class, suppose that we rst divide the input into groups of 5 elements. After medians of all groups {x1,:r2,:r3,:r4,$5}, {3:6,:r7,$3,rrg,$m}, are found, we recursively nd 711, the median of these medians. Is m necessarily the median of the input elements 11:1, :32, ..., inn? Why or why not? (b) If the median of medians is always the true median in the selection algorithm, what is the running time of the selection algorithm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
