码迷,mamicode.com
首页 > 编程语言 > 详细

[LintCode] Wiggle Sort 扭动排序

时间:2016-05-17 00:46:07      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:

 

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 扭动排序

标签:

原文地址:http://www.cnblogs.com/grandyang/p/5500067.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!