Here is my code:

```
public static void wiggleSort(int[] nums) {
if (nums == null || nums.length == 0) {
return;
}
int[] sorted = Arrays.copyOf(nums, nums.length);
Arrays.sort(sorted);
int n = nums.length, m = n | 1;
for (int i = 0; i <= n / 2; i++) {
if (2 * i < n) {
nums[2 * i] = sorted[n / 2 - i];
}
if (n / 2 + 1 + i < n) {
nums[1 + 2 * i] = sorted[n / 2 + 1 + i];
}
}
}
```