From 644eaf99ff2f283bfc96e050e5e03bc359804a40 Mon Sep 17 00:00:00 2001 From: "Prime.X" Date: Thu, 14 Mar 2024 20:25:21 +0800 Subject: [PATCH] fix: code comments for insertion_sort.go (#1132) * fix: code comments for insertion_sort.go * Update insertion_sort.go --------- Co-authored-by: Prime Xiao Co-authored-by: Yudong Jin --- codes/go/chapter_sorting/insertion_sort.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/go/chapter_sorting/insertion_sort.go b/codes/go/chapter_sorting/insertion_sort.go index 5fb3008b3..de57e7529 100644 --- a/codes/go/chapter_sorting/insertion_sort.go +++ b/codes/go/chapter_sorting/insertion_sort.go @@ -6,7 +6,7 @@ package chapter_sorting /* 插入排序 */ func insertionSort(nums []int) { - // 外循环:未排序区间为 [0, i] + // 外循环:已排序区间为 [0, i-1] for i := 1; i < len(nums); i++ { base := nums[i] j := i - 1