[Sort]希尔排序
来源:互联网 发布:高清网络摄像机软件 编辑:程序博客网 时间:2024/06/05 19:33
详细介绍,在本博客的数据结构栏目里有,不过是java版
#include<iostream>using namespace std;void Shell_Sort(int a[],int num){ int d,i,j,c; for(d = num/2;d>0;d/=2) { for(i = d;i<num;i++) { if(a[i] < a[i-d]) { c = a[i]; for(j=i-d;a[j]> c && j>=0;j-=d) { a[j+d] = a[j]; } a[j+d] = c; } } }}void main(){ int a[] = {57,68,59,52,72,28,96,33,24}; int count = sizeof(a) / sizeof(a[0]); Shell_Sort(a,count); for(int i=0;i<count;i++) { cout<<a[i]<<" "; } cout<<endl;}
0 0
- Shell Sort 希尔排序
- 希尔排序(Shell Sort)
- 希尔排序(Shell Sort)
- 希尔排序(Shell Sort)
- 希尔排序(Shell Sort)
- 希尔排序/shell sort
- 希尔排序(Shell Sort)
- 希尔排序 shell sort
- 希尔排序Shell Sort
- 希尔排序(shell sort)
- 希尔排序Shell sort
- 希尔排序 shell sort
- 希尔排序Shell sort
- 希尔排序shell sort
- Shell Sort 希尔排序
- 希尔排序 shell sort
- [Sort]希尔排序
- 希尔排序(Shell Sort)
- Android 进阶 Fragment 介绍和使用 (二)
- 南大软院大神养成计划--第十三天活动
- 10行代码搞定PHP页面静态化(10 lines of code to get PHP static pages)
- 10-01 到 11-29的项目总结
- 《leetCode》:Simplify Path
- [Sort]希尔排序
- Trie树及其应用
- u盘格式化的格式及分配单元大小
- 测试1129
- hpuoj--校赛--爬楼梯(模拟)
- 周总结
- 一个程序猿成长记:设置select的selected属性
- POJ 2376Cleaning Shifts
- Java递归应用:输出树形菜单