文件名称:ShellSort
介绍说明--下载内容均来自于网络,请自行研究使用
首先取一个整数 gap < n(待排序记录数) 作为间隔, 将全部记录分为 gap 个子序列, 所有距离为 gap 的记录放在同一个子序列中
在每一个子序列中分别施行直接插入排序。
然后缩小间隔 gap, 例如取 gap = gap/2
重复上述的子序列划分和排序工作,直到最后取gap = 1, 将所有记录放在同一个序列中排序为止-First, take an integer gap < n (the number of records to be sorted) as the interval, all records will be divided into sub-sequence gap, all distances for the gap recorded in the same sub-sequence, respectively, in each sub-sequence directly into sorting purposes. Then narrow spacing gap, for example, take the gap = gap/2 sequence described above is repeated division and sorting work, until finally take gap = 1, all records in the same sort sequence so far
在每一个子序列中分别施行直接插入排序。
然后缩小间隔 gap, 例如取 gap = gap/2
重复上述的子序列划分和排序工作,直到最后取gap = 1, 将所有记录放在同一个序列中排序为止-First, take an integer gap < n (the number of records to be sorted) as the interval, all records will be divided into sub-sequence gap, all distances for the gap recorded in the same sub-sequence, respectively, in each sub-sequence directly into sorting purposes. Then narrow spacing gap, for example, take the gap = gap/2 sequence described above is repeated division and sorting work, until finally take gap = 1, all records in the same sort sequence so far
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ShellSort.cpp