public void sort ( int data [ ] , int begin , int end ) { histogram . fill ( 0 ) ; for ( int i = begin ; i < end ; i ++ ) { histogram . data [ data [ i ] - minValue ] ++ ; } // over wrist the input data with sorted elements int index = begin ; for ( int i = 0 ; i < histogram . size ; i ++ ) { int N = histogram . get ( i ) ; int value = i + minValue ; for ( int j = 0 ; j < N ; j ++ ) { data [ index ++ ] = value ; } } }
Sorts the data in the array .