Fix quick_sort.py

This commit is contained in:
krahets
2023-02-21 21:51:56 +08:00
parent b89ea3eba4
commit 0b72fef381
11 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ const QuickSortMedian = struct {
// 选取三个元素的中位数
pub fn medianThree(nums: []i32, left: usize, mid: usize, right: usize) usize {
// 使用异或操作来简化代码
// 此处使用异或运算来简化代码
// 异或规则为 0 ^ 0 = 1 ^ 1 = 0, 0 ^ 1 = 1 ^ 0 = 1
if ((nums[left] < nums[mid]) != (nums[left] < nums[right])) {
return left;