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
Eisenstein integer integer is said to be an Eisenstein prime if its only non-unit divisors are of the form , where is any of the six units. There are two types of Eisenstein primes. First, an ordinary prime number (or "rational prime") which is congruent to is also an Eisenstein prime. Second, 3 and any rational prime congruent to is equal to the norm of an Eisentein integer . Thus, such a prime may be factored as , and these factors are Eisenstein primes: they are precisely the Eisenstein integers whose norm is a rational prime. The ring of Eisenstein integers forms