if array is already in sorted order, then quick sort will always run in O(n^2)

if array is already in sorted order, then quick sort will run in O(n^2) if the pivot is starting element.

if array is already in sorted order, then quick sort will run in O(n^2) if the pivot is random element.

if array is already in sorted order, still quick sort will run in O(n log n)

Answer :(B)

if array is already in sorted order, then quick sort will run in O(n^2) if the pivot is starting element.

Description :

if array is already in sorted order, then quick sort will run in O(n^2) if the pivot is starting element. so selecting starting element as pivot is dangerous if array is already sorted. Instead if we select pivot in random order, it runs faster in comparison.