Skip to content

Commit 545fa6d

Browse files
hoop208hustcc
authored andcommitted
Update 4.shellSort.md (#36)
修正希尔排序java实现的gap计算
1 parent a2443c8 commit 545fa6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: 4.shellSort.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class ShellSort implements IArraySort {
9999
int[] arr = Arrays.copyOf(sourceArray, sourceArray.length);
100100

101101
int gap = 1;
102-
while (gap < arr.length) {
102+
while (gap < arr.length/3) {
103103
gap = gap * 3 + 1;
104104
}
105105

0 commit comments

Comments
 (0)