In Quicksort, the worst case occurs when the partitioning routine always produces the most unbalanced split possible (for instance, when the pivot is always the minimum or maximum element).
In this scenario:
One subproblem has size n−1.
The other subproblem has size 1 (or 0).
Partitioning the array takes linear time, cn.
Hence, the recurrence equation representing the worst-case time complexity is:
T(n)=T(n−1)+T(1)+cn This solves to $O(n^2)$. Therefore,Option (B) is the correct choice.