Skip to content

Commit

Permalink
Update merge_sort.py
Browse files Browse the repository at this point in the history
  • Loading branch information
krahets authored May 17, 2024
1 parent 5eea66f commit d74b654
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codes/python/chapter_sorting/merge_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def merge_sort(nums: list[int], left: int, right: int):
if left >= right:
return # 当子数组长度为 1 时终止递归
# 划分阶段
mid = left + (right - left) // 2 # 计算中点
mid = (left + right) // 2 # 计算中点
merge_sort(nums, left, mid) # 递归左子数组
merge_sort(nums, mid + 1, right) # 递归右子数组
# 合并阶段
Expand Down

0 comments on commit d74b654

Please sign in to comment.