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
Almost integer Almost integer In recreational mathematics, an almost integer (or near-integer) is any number that is not an integer but is very close to one. Almost integers are considered interesting when they arise in some context in which they are unexpected. Well-known examples of almost integers are high powers of the golden ratio formula_1, for example: The fact that these powers approach integers is non-coincidental, which is trivially seen because the golden ratio is a Pisot–Vijayaraghavan number. The ratios of Fibonacci or Lucas numbers can also make countless almost integers, for instance: The above examples can be generalized by the following