[LintCode] Wiggle Sort 扭动排序

Posted Grandyang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[LintCode] Wiggle Sort 扭动排序相关的知识,希望对你有一定的参考价值。

 

Given an unsorted array nums, reorder it in-place such that

nums[0] <= nums[1] >= nums[2] <= nums[3]....
Notice

Please complete the problem in-place.

Example
Given nums = [3, 5, 2, 1, 6, 4], one possible answer is [1, 6, 2, 5, 3, 4].

以上是关于[LintCode] Wiggle Sort 扭动排序的主要内容,如果未能解决你的问题,请参考以下文章

280. Wiggle Sort/324. Wiggle Sort II

Wiggle Sort II

LeetCode Wiggle Sort

LeetCode Wiggle Sort II

java 280. Wiggle Sort(#)。java

java 280. Wiggle Sort(#)。java