From 0d4fdfb5a0dcaf88e7a163315d4183d234909ded Mon Sep 17 00:00:00 2001 From: hoop208 <137478244@qq.com> Date: Tue, 13 Aug 2019 19:22:14 +0800 Subject: [PATCH] Update 4.shellSort.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正希尔排序java实现的gap计算 --- 4.shellSort.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/4.shellSort.md b/4.shellSort.md index 187ac0e..cfa59f5 100644 --- a/4.shellSort.md +++ b/4.shellSort.md @@ -99,7 +99,7 @@ public class ShellSort implements IArraySort { int[] arr = Arrays.copyOf(sourceArray, sourceArray.length); int gap = 1; - while (gap < arr.length) { + while (gap < arr.length/3) { gap = gap * 3 + 1; }