Just located to an odd position number and compare its front and behind number.

```
public class Solution {
public void wiggleSort(int[] nums) {
for(int i = 1;i<nums.length;i+=2){
if(nums[i-1] > nums[i]) swap(nums,i);
if( i<nums.length-1 && nums[i+1] > nums[i]) swap(nums,i+1);
}
}
public void swap(int[] nums,int i){
int temp = nums[i-1];
nums[i-1] = nums[i];
nums[i] = temp;
}
}
```