In computer science, counting sort is an algorithm for sorting a collection of objects according to keys that are small integers ; that is, it is an integer sorting algorithm. It operates by counting the number of objects that have each distinct key ...