Searching, Sorting & Selection

Answer & solution
Official answer: C
1. The median of n distinct values for odd n is their order statistic of rank (n+1)/2. Finding that one rank does not require sorting every value.
2. Apply deterministic worst-case linear-time selection to each array. The median-of-medians selection algorithm, for example, finds an exact order statistic in O(n) time per array.
3. There are n arrays, so obtaining all their medians costs n×O(n)=O(n²). Store the n resulting medians in a separate array.
4. Apply linear-time selection once more to those n medians. This adds O(n), so the total remains O(n²), identifying C. The desired statistic is the median of array medians, which is not in general the median of all n² input values.
5. Sorting each original array would cost O(n² log n) and is unnecessary. Worst-case exact selection on arbitrary unsorted rows requires inspecting linearly many entries in potentially decisive rows; the general problem has quadratic worst-case scale, not O(n) or O(n log n) in the row count n. Randomized quickselect offers expected linear selection, but deterministic selection is what directly justifies the worst-case bound here.