mirror of
https://github.com/krahets/hello-algo.git
synced 2025-01-23 14:20:29 +08:00
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>
This commit is contained in:
parent
01c67781fa
commit
644eaf99ff
@ -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…
Reference in New Issue
Block a user