Selection sort
来源:互联网 发布:php xss防御 编辑:程序博客网 时间:2024/05/20 15:59
Java implementation:
public class Selection{ public static void sort(Comparable[] a) { int N = a.length; for (int i = 0; i < N; i++){ int min = i; for (int j = i+1; j<N; j++){ if (less(a[j], a[min])){ min = j; } exch(a,i,min); } } private static boolean less(Comparable v, Comparable w) {} private static void exch(Comparable a, int i, int j){}}
The time cost is quadratic.
0 0
- Selection sort
- Selection Sort
- Selection sort
- Selection Sort
- selection sort
- selection sort
- Selection sort
- 选择排序(selection sort)
- 选择排序(Selection Sort)
- The Selection Sort
- Algorithm---Selection Sort
- selection sort 选择排序
- 选择排序 Selection Sort
- 选择排序(Selection Sort)
- 选择排序(Selection Sort)
- 选择排序 (Selection Sort)
- 选择排序(Selection sort)
- 选择排序 (Selection sort)
- Service与Notification的结合使用实现文件下载
- 使用设计模式改善程序结构(一)
- SORT QSORT
- Highcharts使用指南
- 如何确保 Shell 脚本只有一个实例运行
- Selection sort
- 一些iOS常用的第三方库和控件
- 使用设计模式改善程序结构(三)
- cocos2dx3.4开发环境搭建详解(1)
- Request和Response详解
- 64位系统下gcc按照32位编译c程序
- sendto发送UDP包的时候,如果发不出去,可能是没有bind的原因
- android测试之一:测试环境ADB搭建
- Json应用