From 9b2a12dd6156ccebd51e50736c66d13799425a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9C=86?= <61506177+FangYuan33@users.noreply.github.com> Date: Tue, 29 Nov 2022 09:44:12 +0800 Subject: [PATCH] Update quick_sort.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 我觉得可以修改下这行代码注释,因为我看到这里的时候,“返回基准数的索引”让我理解的是返回代码第一行定义的基准数的索引,虽然上一行代码已经将基准数索引修改到了分界线处,但还需要思考一下,我觉得写成“返回分界线的索引”更加直白 --- docs/chapter_sorting/quick_sort.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/chapter_sorting/quick_sort.md b/docs/chapter_sorting/quick_sort.md index c9488f1d1..35af10d04 100644 --- a/docs/chapter_sorting/quick_sort.md +++ b/docs/chapter_sorting/quick_sort.md @@ -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 "快速排序的分治思想"