Counting sort initialization of the output array, each take time. Therefore, the time for the whole algorithm is the sum of the times for these steps, . Because it uses arrays of length and , the total space usage of the algorithm is also . For problem instances in which the maximum key value is significantly smaller than the number of items, counting sort can be highly space-efficient, as the only storage it uses other than its input and output arrays is the Count array which uses space . If each item to be sorted is itself an integer, and used as
Integer sorting which runs in time ; this is an improvement over comparison sorting for any choice of and . An alternative version of their algorithm that includes the use of random numbers and integer division operations improves this to . Since their work, even better algorithms have been developed. For instance, by repeatedly applying the Kirkpatrick–Reisch range reduction technique until the keys are small enough to apply the Albers–Hagerup packed sorting algorithm, it is possible to sort in time ; however, the range reduction part of this algorithm requires either a large memory (proportional to ) or randomization in the form