Skip to content

Sorting

The fastest possible algorithm that uses comparisons to sort \(N\) items must use \(\text{O}(N \log{N})\) time.

images 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.

images Algorithms

Such as heap sort, quick sort, and merge sort, are more complicated but much faster.

Sub images 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.

Comments