首页 > 编程语言 > 详细

[LintCode] Wiggle Sort 扭动排序

时间:2016-05-17 00:43:36      阅读:165      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!