Quicksort is a divide-and-conquer sorting algorithm that works as follows:
1) Partition the array around a pivot element into two subarrays such that all elements in one subarray are less than or equal to the pivot and all elements in the other subarray are greater than the pivot.
2) Recursively sort the two subarrays.
3) The entire array is now sorted.
The performance of quicksort depends on how balanced the partition is - in the best case of a perfectly balanced partition, it runs in O(n log n) time, but in the worst case of a maximally unbalanced partition, it runs in O(n^2) time. The choice of