public static void main(String args[]) {
        int input[] = {50, 40, 70, 60, 90};
        int index[] = {3,  0,  4,  1,  2};
        ReorderArrayByIndex reorderArrayByIndex = new ReorderArrayByIndex();
        reorderArrayByIndex.reorder(input, index);
        Arrays.stream(input).forEach(i -> System.out.print(i + " "));
        System.out.println();
        Arrays.stream(index).forEach(i -> System.out.print(i + " "));
    }
Date 12/29/2015
@author Tushar Roy

Given two arrays one with values and other with index where values should be positioned. Move values to correct
position

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

http://www.geeksforgeeks.org/reorder-a-array-according-to-given-indexes/
src/com/interview/array/ReorderArrayByIndex.java