选择排序
来源:互联网 发布:手机淘宝社区 编辑:程序博客网 时间:2024/06/10 07:48
//选择查找public class SelectionSort {public static void selectionSort(double[] list){for(int i=0;i<list.length-1;i++){double currentMin=list[i];int currentMinIndex=i;for(int j=i+1;j<list.length;j++){if(currentMin>list[j]){currentMin=list[j];currentMinIndex=j;}}if(currentMinIndex!=i){list[currentMinIndex]=list[j];list[i]=currentMin;}}}}
0 0
- 选择排序
- 选择排序
- 选择排序
- 选择排序
- 选择排序
- 选择排序
- 选择排序
- 选择排序
- 选择排序:
- 选择排序
- 选择排序
- 选择排序
- 选择排序
- 选择排序
- 选择排序
- 选择排序
- 选择排序
- 选择排序
- 搭建时间服务器和设置FQDN主机名
- ftp服务器遇到的问题
- hdu 5412 CRB and Queries 求动态区间第k小 树套树
- 轻松python专题--文本
- 读书有感之《从零到一》
- 选择排序
- 零基础学C语言 笔记三 三种方法交换两个变量的值
- IOS_代码实现树形导航
- MVC初步理解
- c++引用返回值
- 【android ndk】macos环境下Android Studio中利用gradle编译jni模块及配置
- 归并排序算法 C代码实现(算法)
- ConcurrentHashMap
- 由浅入深理解Activity的诞生