Answer: C
Explanation: If pivot is smallest/largest → highly unbalanced recursion → O(n²).
Best Case / Average Case: Pivot divides the array almost equally each time.
Example: size n = 16, pivot splits into 8 + 7.
Recurrence: T(n) = 2T(n/2) + Θ(n)
⇒ Θ(n log n)
Depth of recursion = log n, each level costs Θ(n).
Total = Θ(n log n).
Worst Case (Pivot = smallest/largest element)
Suppose pivot is always the smallest element:
Left side = 0 elements, Right side = n−1 elements.
Example: Sorting [1, 2, 3, 4, 5] with pivot = smallest.
Recurrence becomes: T(n) = T(n−1) + Θ(n)
Partitioning costs Θ(n). Then we recurse on n−1 elements.
T(n) = T(n−1) + n
= T(n−2) + (n−1) + n
= …
= Θ(1 + 2 + 3 + … + n)
= Θ(n²)