Searching, Sorting & Selection

Answer & solution
Answer: D in general; C for standard end-pivot worst-case counting (no official key was published)
With the first or last element chosen as pivot on every subarray, either monotone input can split into sizes 0 and n−1. Counting n−1 comparisons per partition gives n(n−1)/2 for both orientations, the usual equality answer C under that model. But the question does not specify pivot selection or partition code. A rule depending on input orientation can select balanced pivots in one case and extreme pivots in the other; even comparison-count conventions vary. Therefore no implementation-independent ordering follows, corresponding to D. The common equal-count result is conditional, not a universal theorem about every quicksort variant.