当前位置:网站首页>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];
}
}
}
边栏推荐
- GBase8s数据库select有ORDER BY 子句5
- 535. encryption and decryption of tinyurl: design a URL simplification system
- MySQL 主从复制原理以及流程
- Dragon Book tiger Book whale Book gnawing? Try the monkey book with Douban score of 9.5
- 谷粒商城项目
- LM07丨细聊期货横截面策略
- cmake 报错
- What are outer chain and inner chain?
- Syntax of gbase8s database incompatible with for update clause
- Gbase8s database into temp clause creates a temporary table to save query results.
猜你喜欢

oracle 19c : change the user sys/system username pasword under Linux

【云原生】2.4 Kubernetes 核心实战(中)

Helping the ultimate experience, best practice of volcano engine edge computing

Wonderful! Miaoying technology fully implements Zadig to help container construction, and fully embraces kubernetes and Yunyuan

MIT linear algebra Chinese Notes

推荐模型复现(二):精排模型DeepFM、DIN

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

ERP Kingdee for preparing BOM

《高难度谈话》突破谈话瓶颈,实现完美沟通

Kyligence Zen, an intelligent indicator driven management and decision-making platform, is newly launched and is in limited internal testing
随机推荐
文件包含之日志中毒(User-Agent)
GBase8s数据库select有ORDER BY 子句5
How to fix ora-01017: invalid user name / password login denied
MIT线性代数中文笔记
智能指标驱动的管理和决策平台 Kyligence Zen 全新上线,限量内测中
GBase8s数据库select有HAVING 子句
《自卑与超越》生活对你应有的意义
ERP Kingdee for preparing BOM
MySQL master-slave synchronous asynchronous replication semi synchronous replication full synchronous replication
Li Kou daily question - day 31 -1779 Find the nearest point with the same X or Y coordinate
论文复现——AC-FPN:Attention-guided Context Feature Pyramid Network for Object Detection.
Gbase 8s extended external connection 1
535. encryption and decryption of tinyurl: design a URL simplification system
Some printer driver PPD files of Lenovo Lingxiang lenovoimage
《高难度谈话》突破谈话瓶颈,实现完美沟通
How can colleges and universities build future oriented smart campus based on cloud native? Full stack cloud native architecture vs traditional IT architecture
nacos启动报错
Method area of JVM
揭秘百度智能测试在测试自动执行领域实践
Gbase8s database select has order by Clause 3