public void rearrange(int input[]) {

        for (int i = 0; i < input.length; i++) {
            input[i]++;
        }

        for (int i = 0; i < input.length; i++) {
            if (input[i] > 0) {
                rearrangeUtil(input, i);
            }
        }

        for (int i = 0; i < input.length; i++) {
            input[i] = -input[i] - 1;
        }
    }
Date 12/30/2015

Given an array of size n where elements are in range 0 to n-1. Rearrange elements of array
such that if arr[i] = j then arr[j] becomes i.

Time complexity O(n)
Space complexity O(1)

http://www.geeksforgeeks.org/rearrange-array-arrj-becomes-arri-j/
src/com/interview/array/RearrangeArrayPerIndex.java