Quick Sort is a sorting algorithm that works by selecting a pivot from a list, and then reordering the list so that all of the elements that are smaller than the pivot go to the left, and all of the elements that are larger than the elements go to the right. Quick sort then recursively applies this algorithm to each of the smaller/larger sublists until the pivots have reached their correct sorted position in the list. The point where a recursize operation terminates in a quick sort is called the partition operation.
[Example] [Example]
[Resource] [Resource]
Performance | |
---|---|
Worst case performance | O(n2) |
Best case performance | Ω(n log n) |
Average case performance | O(n log n) |