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-valued function them. In number theory, many arithmetic functions are integer-valued. In computer programming many functions return values of integer type due to simplicity of implementation. Integer-valued function In mathematics, an integer-valued function is a function whose values are integers. In other words, it is a function that assigns an integer to each member of its domain. Floor and ceiling functions are examples of an integer-valued function of a real variable, but on real numbers and generally, on (non-disconnected) topological spaces integer-valued functions are not especially useful. Any such function on a connected space either has discontinuities or is constant. On the