4. Assume you have an algorithm that finds the median of nelements in cn lg lg n−n comparison steps (for some constantc).
(a) Give an efficient (recursive) algorithm for selection basedon this. It will, of course, not be linear time.
(b) Write a recurrence for the number of comparisons youralgorithm uses.
(c) Solve the recurrence using constructive induction. Just getthe high order term exactly.
(d) Why might it be a good algorithm despite not being lineartime?
Answer