当前位置:网站首页>2022.6.28-----leetcode.324
2022.6.28-----leetcode.324
2022-06-29 11:49:00 【路Lu727】
public void wiggleSort(int[] nums) {
int[] arr = nums.clone();
Arrays.sort(arr);
int n = nums.length;
int x = (n + 1) / 2;
for (int i = 0, j = x - 1, k = n - 1; i < n; i += 2, j--, k--) {
nums[i] = arr[j];
if (i + 1 < n) {
nums[i + 1] = arr[k];
}
}
}
边栏推荐
- Gbase8s database select has an order by clause
- 二十三、1-Bit数据的存储(延迟线/磁芯/DRAM/SRAM/磁带/磁盘/光盘/Flash SSD)
- Pro test! Centos7 deploy PHP + spool
- ShanDong Multi-University Training #3
- Unexpected ‘debugger‘ statement no-debugger
- 谷粒商城项目
- 力扣每日一题-第31天-1779.找到最近的有相同x或y坐标的点
- 文件包含之日志中毒(User-Agent)
- 揭秘百度智能测试在测试自动执行领域实践
- Interpolated scatter data
猜你喜欢

Weekly recommended short video: How did Einstein think?

Unified exception reporting practice based on bytecode

Pro test! Centos7 deploy PHP + spool

JVM之方法区

测试--自动化测试:关于unittest框架

高校如何基于云原生构建面向未来的智慧校园?全栈云原生架构VS传统IT架构

地球观测卫星数据

How to install oracle19c in Centos8

Baidu cloud disk downloads large files without speed limit (valid for 2021-11 personal test)

揭秘百度智能测试在测试自动执行领域实践
随机推荐
Difficult conversation breaks through the bottleneck of conversation and achieves perfect communication
AGCO AI frontier promotion (6.29)
Inferiority complex and transcendence the meaning of life to you
Engineering practice behind dall-e 2: ensure that the output of the model complies with the content policy
[JUC series] ThreadLocal of synchronization tool class
Is it safe for Orient Fortune Securities to open an account? Handling of securities account opening
ArtBench:第一个类平衡的、高质量的、干净注释的和标准化的艺术品生成数据集
Go Senior Engineer required course | I sincerely suggest you listen to it. Don't miss it~
Artbench: the first class balanced, high-quality, clean annotated and standardized artwork generation data set
Pro test! Centos7 deploy PHP + spool
推荐模型复现(三):召回模型YoutubeDNN、DSSM
GBase8s数据库与 FOR UPDATE 子句不兼容的语法
内插散点数据
QQ集体被盗号,猝不及防的大型社死名场面
Bison uses error loop records
Quick look | the long-awaited 2022 Guangzhou assistant testing engineer's real problem analysis is finally released
How to create new user for ORACLE 19c (CDB & PDB)
535. encryption and decryption of tinyurl: design a URL simplification system
【综合案例】信用卡虚拟交易识别
Easy express: we use Zadig to realize 10000 times of construction and deployment, smart operation and maintenance, and release development productivity