private void sort(int arr[],int n, int exp){
        int count[] = new int[n];
        for(int i=0; i < arr.length;i++){
            count[(arr[i]/exp)%n]++;
        }
        
        for(int i=1; i < arr.length; i++){
            count[i] += count[i-1];
        }
    
        int output[] = new int[n];
        
        for(int i=arr.length-1;i>=0; i--){
            output[count[(arr[i]/exp)%n]-1] = arr[i];
            count[(arr[i]/exp)%n]--;
        }
        for(int i=0; i < arr.length; i++){
            arr[i] = output[i];
        }
    }
http://www.geeksforgeeks.org/sort-n-numbers-range-0-n2-1-linear-time/
src/com/interview/sort/Sort0toN3.java