MCPcopy Create free account
hub / github.com/Ewenwan/ShiYanLou / ShellSort

Function ShellSort

datastructure_code/sort/7.2ShellSort.c:42–62  ·  view source on GitHub ↗

https://www.cnblogs.com/chengxiao/p/6104371.html * 希尔排序 间隔增量 插入排序 希尔排序也是插入排序的一种,但它在效率上要比上面的直接插入排序高, 它是对直接插入排序的改进,它的基本思想是先取一个小于n的整数d1作为第一个增量, 把文件的全部记录分组。 所有距离为d1的倍数的记录放在同一个组中。 先在各组内进行直接插入排序; 然后,取第二个增量d2< d1重复上述的分组和排序, 直至所取的增量dt=1(dt<…< d2< d1),即所有记录放在同一组中进行直接插入排序为止, 增量序列尤为关键,一般的初次取序列的一半为增量,以后每次减半,直到增量为1 // 希尔排序 之间插入排序的 改进版本 // 希尔排序是把记录按下标的一定增量分组,对每组使用直接插入排序算法排序; // 随着增

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected