public void rearrange(int arr[]){
        for(int i=0; i < arr.length; i++){
            int temp;
            if(arr[arr[i]] > arr.length-1){
                temp = arr[arr[i]]/arr.length-1;
            }else{
                temp = arr[arr[i]];
            }
            arr[i] = temp + arr.length*(arr[i]+1);
        }
        
        for(int i=0; i < arr.length;i++){
            arr[i] = arr[i] % arr.length;
        }
    }
http://www.geeksforgeeks.org/rearrange-given-array-place/
src/com/interview/array/RearrangeSuchThatArriBecomesArrArri.java