Select Sort
来源:互联网 发布:模特接单软件 编辑:程序博客网 时间:2024/06/05 16:11
public class SelectSort{public void selectSort(int[] data, boolean isDesc){for(int i = 0; i < data.length - 1; i++){int temp = i;for(int j = i+1; j< data.length; j++){if((isDesc == false)&&(data[j] < data[temp])){temp = j;}if((isDesc == true)&&(data[j] > data[temp])){temp = j;}}swap(data, i, temp);}}private void swap(int[] data, int m, int n){int temp = data[m];data[m] = data[n];data[n] = temp;}}
阅读全文
0 0
- select-sort
- Select Sort
- Select Sort
- Sort Algorithm-->Select Sort
- Select Sort & Bubble Sort
- select sort algorithm
- Select和Sort状态变量
- JAVA Select Sort
- 选择排序----select sort
- Select Sort Algorithm
- sorting - select sort
- 选择排序(select sort)
- Select Sort in scala
- 选择排序Select Sort
- Algorithm intro - Select Sort
- 选择排序-Select Sort
- 选择排序 select sort
- Insertion sort, select sort, Quick sort and Merge sort
- springboot-配置文件
- 【小工具】页面加载获取url param
- springboot-Controller
- 《Java EE互联网轻量级框架整合开发》在京东预售,发个目录
- springboot-数据库
- Select Sort
- 六大设计原则
- Spring Boot 集成mybatis(gradle)
- android命名逻辑
- 使用一个小例子解释Java回调/代理机制
- springboot-数据校验、异常处理、单元测试、打包、日志
- Single Number III
- meteor 自动安装 [开启灯笼][官方安装包]
- springboot-模版