It looks like bubble sort. Very easy.

```
class Solution {
public:
void wiggleSort(vector<int>& nums) {
while(true){
int less = 1;
int k = 0;
for(int i = 1; i < nums.size(); ++i){
if(less){
if(nums[i-1] > nums[i]){swap(nums[i-1], nums[i]); k = 1;}
}else{
if(nums[i-1] < nums[i]){swap(nums[i-1], nums[i]); k = 1;}
}
less = less ^ 1;
}
if(k == 0) return;
}
}
};
```