Quick Sort has an average-case performance of O(n log n). However, the worst-case performance happens when the pivot element selected is either the smallest or largest element in the list. This may occur in two scenarios: when the array contains all the same elements, or when the elements are already sorted.
https://blog.beautyyu.one/details-of-quick-sort
Quick Sort has an average-case performance of O(n log n). However, the worst-case performance happens when the pivot element selected is either the smallest or largest element in the list. This may occur in two scenarios: when the array contains all the same elements, or when the elements are already sorted.