If the elements in the array are sorted(ascending/descending), quick sort takes O(n^2). and as the elements are distinct as mentioned in question, third case being if the elements are same doesn’t apply here. The above mentioned are worst cases for quick sort.