update at 2021-06-09 09:14:40 by ehlxr

dev
ehlxr 2021-06-09 09:14:40 +08:00
parent 8d2f0d57b5
commit f581b143dc
1 changed files with 1 additions and 1 deletions

View File

@ -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] 后移