From 305dae103736f39489bf66da8764bc8b33db90fa Mon Sep 17 00:00:00 2001 From: Kevin Xu Date: Wed, 24 Apr 2019 13:59:18 +0800 Subject: [PATCH] fix isSorted --- docs/notes/算法 - 排序.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/notes/算法 - 排序.md b/docs/notes/算法 - 排序.md index 8b6142e8..ad304440 100644 --- a/docs/notes/算法 - 排序.md +++ b/docs/notes/算法 - 排序.md @@ -95,7 +95,7 @@ public class Bubble> extends Sort { int N = nums.length; boolean isSorted = false; for (int i = N - 1; i > 0 && !isSorted; i--) { - hasSorted = true; + isSorted = true; for (int j = 0; j < i; j++) { if (less(nums[j + 1], nums[j])) { isSorted = false;