Based on the DIVIDE AND CONQUER logic, this algorithm takes a pivot and use it to make a partition to sort the new partition. You can pick different types of pivot, a random one, the last or the first one.
| Condition | Time complexity | Space Complexity |
|---|---|---|
| Best | Ω(n log(n)) | |
| Average | Ω(n log(n)) | |
| Worst | O(n^2) | O(log(n)) |