From f581b143dcfdd1009a40a2a75fad206938e0cb89 Mon Sep 17 00:00:00 2001 From: ehlxr Date: Wed, 9 Jun 2021 09:14:40 +0800 Subject: [PATCH] update at 2021-06-09 09:14:40 by ehlxr --- src/main/java/io/github/ehlxr/sort/InsertSort.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/ehlxr/sort/InsertSort.java b/src/main/java/io/github/ehlxr/sort/InsertSort.java index 22f3d74..f1cbcce 100644 --- a/src/main/java/io/github/ehlxr/sort/InsertSort.java +++ b/src/main/java/io/github/ehlxr/sort/InsertSort.java @@ -61,7 +61,7 @@ public class InsertSort { public static void sort2(int[] arr) { for (int i = 1; i < arr.length; i++) { - int value = arr[i]; // 一个元素(新元素) + int value = arr[i]; // 下一个元素(新元素) int j = i - 1; // 已排序的最后一个元素下标 while (j >= 0 && arr[j] > value) { arr[j + 1] = arr[j]; // arr[j] 后移