fix: code comments for insertion_sort.go (#1132)

* fix: code comments for insertion_sort.go

* Update insertion_sort.go

---------

Co-authored-by: Prime Xiao <primexiao.dev@gmail.com>
Co-authored-by: Yudong Jin <krahets@163.com>
pull/1137/head
Prime.X 8 months ago committed by GitHub
parent 01c67781fa
commit 644eaf99ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -6,7 +6,7 @@ package chapter_sorting
/* 插入排序 */ /* 插入排序 */
func insertionSort(nums []int) { func insertionSort(nums []int) {
// 外循环:未排序区间为 [0, i] // 外循环:已排序区间为 [0, i-1]
for i := 1; i < len(nums); i++ { for i := 1; i < len(nums); i++ {
base := nums[i] base := nums[i]
j := i - 1 j := i - 1

Loading…
Cancel
Save