当前位置:网站首页>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];
}
}
}
边栏推荐
- 推荐模型复现(二):精排模型DeepFM、DIN
- Wonderful! Miaoying technology fully implements Zadig to help container construction, and fully embraces kubernetes and Yunyuan
- 墨菲安全入选中关村科学城24个重点项目签约
- 【JUC系列】同步工具类之ThreadLocal
- MySQL数据库主从同步,一致性解决方案
- How to create new user for ORACLE 19c (CDB & PDB)
- When a technician becomes a CEO, what "bugs" should be modified?
- How to create new user for ORACLE 19c (CDB & PDB)
- 《自卑与超越》生活对你应有的意义
- Gbase8s database select has order by Clause 6
猜你喜欢

在印度与软件相关的发明可不可以申请专利?

Bison uses error loop records

Go Senior Engineer required course | I sincerely suggest you listen to it. Don't miss it~

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

How to install oracle19c in Centos8

How to create new user for ORACLE 19c (CDB & PDB)

Kyligence Zen, an intelligent indicator driven management and decision-making platform, is newly launched and is in limited internal testing

百度云盘不限速下载大文件(2021-11亲测有效)

面试突击61:说一下MySQL事务隔离级别?

Weekly recommended short video: How did Einstein think?
随机推荐
GBase8s数据库select有ORDER BY 子句6
Weekly recommended short video: How did Einstein think?
百度云盘不限速下载大文件(2021-11亲测有效)
推荐模型复现(四):多任务模型ESMM、MMOE
面试突击61:说一下MySQL事务隔离级别?
面试突击61:说一下MySQL事务隔离级别?
ERP preparation of bill of materials Huaxia
Gbase8s database select has order by Clause 1
DALL-E 2背后的工程实践:确保模型的输出符合内容政策
Earth observation satellite data
GBase8s数据库select有ORDER BY 子句2
文件包含之日志中毒(User-Agent)
Paper reproduction - ac-fpn:attention-guided context feature pyramid network for object detection
面试突击61:说一下MySQL事务隔离级别?
bison使用error死循环的记录
How to fix ora-01017: invalid user name / password login denied
How do I open an account now? Is there a faster and safer opening channel
Is it safe for Hengtai securities to open an account? Ranking of securities
GBase8s数据库在组合查询中的集合运算符
Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?