当前位置:网站首页>2022.6.28-----leetcode. three hundred and twenty-four
2022.6.28-----leetcode. three hundred and twenty-four
2022-06-29 12:38:00 【Lu 727】
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];
}
}
}
边栏推荐
- 推荐模型复现(四):多任务模型ESMM、MMOE
- cmake 报错
- GBase8s数据库INTO TEMP 子句创建临时表来保存查询结果。
- ERP preparation of bill of materials Huaxia
- Go learning - build a development environment vscode development environment golang
- 对p值的理解
- Gbase8s database for read only clause
- Bison uses error loop records
- 测试--自动化测试:关于unittest框架
- ShanDong Multi-University Training #3
猜你喜欢

Interview shock 61: tell me about MySQL transaction isolation level?

An interpretable geometric depth learning model for structure based protein binding site prediction

ERP Kingdee for preparing BOM

一种可解释的几何深度学习模型,用于基于结构的蛋白质结合位点预测

The blackened honeysnow ice city wants to grasp the hearts of consumers by marketing?

Proteus软件初学笔记

MySQL 主从复制原理以及流程

模糊图片变清晰,一键双色图片,快速整理本地图片...这8个在线图片工具申请加入你的收藏夹!

ERP编制物料清单 华夏

MIT linear algebra Chinese Notes
随机推荐
[comprehensive case] credit card virtual transaction identification
【JUC系列】同步工具类之ThreadLocal
对p值的理解
内插散点数据
Pangolin编译error: ‘numeric_limits’ is not a member of ‘std’
Do you think people who learn machinery are terrible?
推荐模型复现(四):多任务模型ESMM、MMOE
谷粒商城项目
Interview shock 61: tell me about MySQL transaction isolation level?
缓存一致性,删除缓存,写入缓存,缓存击穿,缓存穿透,缓存雪崩
Gbase8s database sorts standard or raw result tables
MIT线性代数中文笔记
Factorization of large numbers ← C language
GBase8s数据库在组合查询中的集合运算符
ShanDong Multi-University Training #3
Difficult conversation breaks through the bottleneck of conversation and achieves perfect communication
How to fix ora-01017: invalid user name / password login denied
面试突击61:说一下MySQL事务隔离级别?
论文复现——AC-FPN:Attention-guided Context Feature Pyramid Network for Object Detection.
Gbase 8s extended external connection 1