当前位置:网站首页>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];
}
}
}
边栏推荐
- Dragon Book tiger Book whale Book gnawing? Try the monkey book with Douban score of 9.5
- 论文复现——AC-FPN:Attention-guided Context Feature Pyramid Network for Object Detection.
- How to install oracle19c in Centos8
- 力扣每日一题-第31天-13.罗马数组转整数
- MySQL主从同步之 异步复制 半同步复制 全同步复制
- ERP编制物料清单 基础
- AGCO AI frontier promotion (6.29)
- 在印度与软件相关的发明可不可以申请专利?
- GBase8s数据库INTO TEMP 子句创建临时表来保存查询结果。
- Introduction to multi project development - business scenario Association basic introduction test payroll
猜你喜欢

内插散点数据

Understanding of P value

文件包含之日志中毒(User-Agent)

Matlab GUI realizes the function of clicking the button, opening the file dialog box and importing pictures

【智能QbD风险评估工具】上海道宁为您带来LeanQbD介绍、试用、教程

Quick look | the long-awaited 2022 Guangzhou assistant testing engineer's real problem analysis is finally released

ERP preparation of bill of materials Huaxia

ArtBench:第一个类平衡的、高质量的、干净注释的和标准化的艺术品生成数据集

架构实战营第五模块课后作业

When you are young, you should be awake to fight, and when you are young, you should have the courage to try
随机推荐
How to fix ORA-01017:用户名/口令无效 登录拒绝
MySQL主从同步之 异步复制 半同步复制 全同步复制
oracle 19c : change the user sys/system username pasword under Linux
MySQL master-slave synchronous asynchronous replication semi synchronous replication full synchronous replication
GBase8s数据库与 FOR UPDATE 子句不兼容的语法
力扣每日一题-第31天-1779.找到最近的有相同x或y坐标的点
文件包含之日志中毒(User-Agent)
Blurred pictures become clear, one button two-color pictures, quickly organize local pictures These 8 online picture tools apply to join your favorites!
墨菲安全入选中关村科学城24个重点项目签约
东方财富证券开户安全吗 证券开户办理
How to fix ora-01017: invalid user name / password login denied
How to create new user for ORACLE 19c (CDB & PDB)
Is the table queried by this EMR sparksql node ODPs?
GBase8s数据库INTO table 子句
内插散点数据
What is the main account of Chia Tai futures used for 4 quotation software?
现在怎么开户?有没有更快又安全的开通渠道
Cocos star meetings at Hangzhou station in 2022
Quick look | the long-awaited 2022 Guangzhou assistant testing engineer's real problem analysis is finally released
【综合案例】信用卡虚拟交易识别