Similar questions 2 more →
Searching, Sorting & Selection

Answer & solution
Official answer: 147.1 to 148.1
Our answer: 148 worst-case comparisons
1. Method and setup. Finding extrema separately takes 99+99 comparisons and wastes information. Pair the elements: one comparison per pair identifies a candidate for the minimum and a candidate for the maximum. Thereafter only the pair-losers need participate in the minimum search and only the pair-winners in the maximum search.
2. Work through the result and its assumptions. Compare50 disjoint pairs. Find the minimum among 50 smaller values in 49 comparisons and maximum among 50 larger values in 49. Total 50+49+49=148. This matches the optimal worst-case lower bound ceil(3n/2)−2; an adversary forces enough first comparisons to classify candidates before eliminating all but one in each class.