Searching, Sorting & Selection

Answer & solution
Answer: D: floor(n/2) (no official key was published)
Suppose there are k negative values. Their final region is the first k positions. Let t positives currently lie in that region; exactly t negatives then lie outside it. Pair and swap each misplaced positive with a misplaced negative, requiring t exchanges. Every exchange fixes at most one misplaced negative in the target region, proving optimality. Since t≤min(k,n−k), the worst case over k is floor(n/2), attained by placing balanced sign groups in the wrong halves. Thus none of the listed formulas A–C is the general answer. This uses arbitrary swaps, not adjacent swaps.