Quicksort has a time complexity of O(n log n) in average to sort n items. In the worst case it makes
O(n
2) comparisons.
The in-place version of quicksort has a space complexity of O(log n).
Already sorted data will cause very slow sorting (O(n
2)) because in this implementation the pivot is
chosen as the most right element (biggest element). So every iteration has only one element less.
Wikipedia