MCPcopy Create free account
hub / github.com/142vip/408CSFamily / ShellSortEnhance

Function ShellSortEnhance

code/ds/ShellSort.cpp:27–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26
27void ShellSortEnhance(ElemType Arr[] , int n){
28
29 // 采用k=n/2 幂函数 确认希尔排序的步长
30
31 for(k=n/2;k>=1;n/=2){
32
33 // // 步长为k,则对应分为k个组,分别对其进行 直接插入排序
34
35 for(i=1,i<=k;i++){
36
37 // 第一步: 对应组的元素找出来,组成新的待排序的数列
38 // 第二步: 对待排序数列进行 直接插入排序
39
40 specialStraightInsertSort(ElemType Arr[], int n , int k , int i)
41
42 }
43
44 }
45 // 返回
46 return Arr;
47}
48

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected