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 the square root of their previous magnitude. Repeating this range reduction until the keys are small enough to bucket sort leads to an algorithm with running time . A complicated randomized algorithm of in the word RAM model of computation allows these time bounds to be reduced even farther, to . An integer sorting algorithm is said to be "non-conservative" if it requires a word size that is significantly larger than . As an extreme instance, if , and all keys are distinct, then the set of keys may be sorted in linear time by representing it as a bitvector,