Counting sort

Counting Sort :

n is  number of values in array , k is the range of values (max – min )

Compexity : O(n+k)

Counting sort is a sorting technique to sort an array in linear time. It uses an extra space for counting occurrence  of each object in array. This technique is efficient when range of data is not much larger than number of inputs to be sorted.