Answer is option B,
Worst case occurs in Quick sort when array is either in increasing order or in decreasing order.
Eg. Increasing : [1,2,3,4,5] , decreasing: [5,4,3,2,1]
Recurrence relation of quicksort ,
T(n) = T(k-1) + T(n-k) + O(n)
Case 1] Increasing order:
At that situation pivot always fall at first position of partition ,
Therefore, recurrence relation will be ,
T(n) = T(0) + T(n-1) + O(n) ... (Put k=1)
=O(n^2)
Case 2] decreasing order ,
At this situation the pivot always fall at last of partition,
Therefore recurrence relation will be ,
T(n) = T(n-1)+T(0)+O(n) ... (Put k=n)
=O(n^2)