mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-16 03:59:18 +08:00
Polish the chapter
introduction, computational complexity.
This commit is contained in:
@@ -16,7 +16,7 @@ def sift_down(nums: list[int], n: int, i: int):
|
||||
ma = l
|
||||
if r < n and nums[r] > nums[ma]:
|
||||
ma = r
|
||||
# 若节点 i 最大或索引 l, r 越界,则无需继续堆化,跳出
|
||||
# 若节点 i 最大或索引 l, r 越界,则无须继续堆化,跳出
|
||||
if ma == i:
|
||||
break
|
||||
# 交换两节点
|
||||
|
||||
Reference in New Issue
Block a user