Update quick_sort.md

我觉得可以修改下这行代码注释,因为我看到这里的时候,“返回基准数的索引”让我理解的是返回代码第一行定义的基准数的索引,虽然上一行代码已经将基准数索引修改到了分界线处,但还需要思考一下,我觉得写成“返回分界线的索引”更加直白
This commit is contained in:
方圆 2022-11-29 09:44:12 +08:00 committed by GitHub
parent 193f67f99e
commit 9b2a12dd61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,7 @@ comments: true
swap(nums, i, j); // 交换这两个元素
}
swap(nums, i, left); // 将基准数交换至两子数组的分界线
return i; // 返回基准数的索引
return i; // 返回分界线的索引
}
```
@ -83,7 +83,7 @@ comments: true
swap(nums, i, j); // 交换这两个元素
}
swap(nums, i, left); // 将基准数交换至两子数组的分界线
return i; // 返回基准数的索引
return i; // 返回分界线的索引
}
```
@ -103,7 +103,7 @@ comments: true
nums[i], nums[j] = nums[j], nums[i]
# 将基准数交换至两子数组的分界线
nums[i], nums[left] = nums[left], nums[i]
return i # 返回基准数的索引
return i # 返回分界线的索引
```
!!! note "快速排序的分治思想"