shell排序 类似于插入排序
来源:互联网 发布:php幸运大转盘源码 编辑:程序博客网 时间:2024/04/28 22:41
1, shell排序 类似于插入排序。
h = 3*h+1
间隔序列中的数字互质。
public void shellSort(){
int inner,outer;
long temp;
int h = 1;
while(h <= nElems/3){
h = h*3 + 1;
}
System.out.println("1 h= "+h);
while(h>0){
for(outer = h;outer<nElems;outer++){
temp = a[outer];
inner = outer;
while(inner > h-1 && a[inner-h] >= temp){
a[inner] = a[inner-h];
inner -= h;
}
a[inner] = temp;
}
h = (h-1)/3;
}
}
Shell 效率:O{N^(3/2)} -O{N^(7/6)}
- shell排序 类似于插入排序
- 插入排序-【Shell排序】
- 插入排序-Shell排序
- 插入排序之----shell排序
- 插入排序之shell排序
- 插入排序与Shell排序
- Shell排序和插入排序
- Shell插入排序
- 插入和shell排序
- shell 实现插入排序
- shell插入排序算法
- 插入排序,选择排序,Shell排序
- 八大排序 -- 插入排序 之 【shell排序】
- 排序:插入排序(直接插入排序、Shell排序)
- 简单插入排序 二分插入排序 shell希尔插入排序
- 直接插入排序、折半插入排序、shell插入排序
- 选择排序,冒泡排序,插入排序,交换排序,shell排序
- 插入排序:直接插入排序 二分法插入排序 表插入排序 Shell排序
- POJ 1200 Crazy Search hash水题
- 递归
- 【ORACLE】oracle9i/10g/11g各种下载
- mssql 数据库还原
- 获取每一帧的长度
- shell排序 类似于插入排序
- Linux Shell中判断某个环境变量是否存在以及获取某个环境变量的值
- mysql 命令
- python之异常处理
- VC++/MFC 小程序 文件/目录对话框 递归遍历文件/文件夹
- 一些iOS高效开源类库
- 快速排序
- Oracle数据库中关键字
- DIV+CSS开发浏览器的兼容性