private int next(int index, int n) {
        return (2*index + 1) % (n | 1);
    }
Date 03/23/2016
@author Tushar Roy

Convert an unsorted array into an array of form num[0] < num[1] > nums[2] < num[3]....

Time complexity O(n) - This depends on KthElementInArray time
Space complexity O(1)

https://leetcode.com/problems/wiggle-sort/
https://leetcode.com/problems/wiggle-sort-ii/
src/com/interview/array/WiggleSort.java