Update a comment in my_heap.

This commit is contained in:
Yudong Jin
2023-01-16 19:30:54 +08:00
parent 8a4a7aa219
commit 592e82818c
3 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ class MaxHeap {
/* 构造函数,根据输入列表建堆 */
public MaxHeap(List<Integer> nums) {
// 所有元素入
// 将列表元素原封不动添加进
maxHeap = new ArrayList<>(nums);
// 堆化除叶结点以外的其他所有结点
for (int i = parent(size() - 1); i >= 0; i--) {