sorting_algorithms icon indicating copy to clipboard operation
sorting_algorithms copied to clipboard

Create Count Sort

Open asmaurya95 opened this issue 8 years ago • 0 comments

This is a Counting Sort Algorithm which can sort lists in linear time under certain constarints. In this sort, we count the frequencies of distinct elements of array and store them in an auxiliary array, by mapping its value as index of auxiliary array and then place each element in its proper position in the output array . Explaination : Let the maximum element which can be in the array is max1 . Now take an array having size of max1 +1 .Let it be Aux[0 ...max1] . A[ ] = array whose elements are to be sorted (n elements ). Out[ ] = array having sorted version of A[ ] .

asmaurya95 avatar Oct 11 '16 20:10 asmaurya95