shell排序
2016-05-05 16:44
405 查看
希尔排序
public Class Shell{ int i, j, temp; int increasement = a.length; do{ increasement = increasement /3 + 1; for(i = increasement; i < a.length; i++){ if(a[i] < a[i - increasement]){ temp = a[i]; for(j = i - increasement; j >=0 && a[j] > temp; j-=increasement){//升序 a[j+increasement]=a[j]; } a[j+increasement] = temp; } } }while(increasement > 1); }
相关文章推荐
- bash
- Linux中profile、bashrc、bash_profile之间的区别和联系
- Shell特殊变量:Shell $0, $#, $*, $@, $?, $$和命令行参数
- linux shell 快捷键.
- shell 基础
- Mac 实用工具bash-comletion介绍安装
- 使用Xshell工具远程Linux环境部署web项目
- shell从入门到放弃(上)
- linux基础之bash特性
- Shell脚本总结
- Bash的基础特性
- 使用shell数据处理数据实例①-------手把手教学版
- shell编程
- 导入第三方依赖到shell
- shell下打包maven工程生成jar包
- IDEA可以正常运行,但是spark-shell不行
- AIX_环境下SHELL脚本设置成crontab调度和手动运行的某些不同
- linux下的shell脚本编程
- Shell脚本学习笔记-条件判断
- Hadoop 2.x Hdfs Shell 命令