Counting sort
Counting sort in an \(O\left(n+m\right)\) sorting algorithm (instead of the usual \(O\left(n\log n\right)\)) for integer values, where \(n\) is the number of elements to sort and \(m\) is the width of the data type (e.g., \(2^{8}\) for byte). Its premise is quite simple. Given enough memory, it creates an array the width of the data […]