| 25 | |
| 26 | |
| 27 | void 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 |
nothing calls this directly
no outgoing calls
no test coverage detected