Sorting¶
The fastest possible algorithm that uses comparisons to sort \(N\) items must use \(\text{O}(N \log{N})\) time.
Algorithms ¶
Sort algorithms such as insertion sort, selection sort & bubble sort are relatively simple but slow.
note
Their simplicity sometimes lets them outperform faster but more complicated algorithms for very small arrays.
Algorithms ¶
Such as heap sort, quick sort, and merge sort, are more complicated but much faster.
Sub
Algorithms ¶
Sorting algorithms such as as counting sort and pigeonhole sort, don't use comparisons to sort items, so they can break the \(O(N \log{N})\) barrier and perform amazingly fast under the right circumstances.