当前位置:网站首页>快速排序
快速排序
2022-06-13 06:58:00 【码道人】
public static void quickSort(int[] arr,int begin,int end){
if(begin>end)
return;
int tmp = arr[begin];
int i =begin;
int j =end;
while (i<j){
while(arr[j]>=tmp && j>i){
j--;
}
arr[i] = arr[j];
while(arr[i]<=tmp && j>i){
i++;
}
arr[j] = arr[i];
}
arr[i] = tmp;
quickSort(arr, begin, i-1);
quickSort(arr, i+1, end);
}边栏推荐
- Cocos creator obtains user authorization interface and encapsulates createuserinfobutton
- 10 Honest Facts I Want To Share With All Junior Developers
- FSM状态机
- 学习Mysql基础第一天
- 怎么写出一份令人惊叹的设计文档?
- 2022-06-12:在N*N的正方形棋盤中,有N*N個棋子,那麼每個格子正好可以擁有一個棋子。 但是現在有些棋子聚集到一個格子上了,比如: 2 0 3 0 1 0 3 0 0 如上的二維數組代錶,一
- 【微弱瞬态信号检测】混沌背景下微弱瞬态信号的SVM检测方法的matlab仿真
- Tidb index optimization
- 上位机开发(固件下载软件之编码调试)
- ML之FE:Vintage曲线/Vintage分析的简介、计算逻辑、案例应用之详细攻略
猜你喜欢

Detailed Mr Atlas of hip joint (Reprinted)
![[Markov chain Monte Carlo] Markov chain Monte Carlo method sampling prior distribution](/img/8a/e6423168e110a168bc3cc6407628f6.png)
[Markov chain Monte Carlo] Markov chain Monte Carlo method sampling prior distribution

Why is the blind box e-commerce mode so popular?

Chain 2+1 reward, what kind of mode is beautiful everyday seconds?

The new business outlet of beautiful Tiantian second mode will be popular in the Internet e-commerce market

The causes of font and style enlargement when the applet is horizontal have been solved

智能金融再升级,景联文科技提供数据采集标注服务

The new retail market has set off blind box e-commerce. Can the new blind box marketing model bring dividends to businesses?

Smart finance is upgraded again, and jinglianwen technology provides data collection and labeling services

Br backup test
随机推荐
MySQL系列之分库分表学习笔记
Application of DS18B20 temperature sensor based on FPGA
十六、IO流(二)
[cloud native | kubernetes] kubernetes configuration
杭州证券开户是安全的吗?
智能文娱稳步发展,景联文科技提供数据采集标注服务
Tidb server tuning
Monotone stack top31 of interview must brush algorithm top101
Tidb statistics
景联文科技提供语音数据采集标注服务
Machine learning notes - supervised learning memo list
牙周炎问题调研(持续进行中)
数据在内存中的存储(C语言)
Ml: introduction to stability analysis of machine learning model and detailed introduction to common solutions
Xiaomi's one-sided interview questions (self sorting answers)
How to make a development board from scratch? Illustrated and illustrated, step by step operation for you to see.
Brief introduction to basic usage of echart
[turn to] FPGA interview questions
DataGridView data export to excel (in case of small amount of data)
面试必刷算法TOP101之单调栈 TOP31