mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-16 03:59:18 +08:00
Update a comment in my_heap.
This commit is contained in:
@@ -24,7 +24,7 @@ func newHeap() *maxHeap {
|
||||
|
||||
/* 构造函数,根据切片建堆 */
|
||||
func newMaxHeap(nums []any) *maxHeap {
|
||||
// 所有元素入堆
|
||||
// 将列表元素原封不动添加进堆
|
||||
h := &maxHeap{data: nums}
|
||||
for i := len(h.data) - 1; i >= 0; i-- {
|
||||
// 堆化除叶结点以外的其他所有结点
|
||||
|
||||
Reference in New Issue
Block a user