mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 12:58:42 +08:00
Update a comment in my_heap.
This commit is contained in:
@ -20,7 +20,7 @@ class MaxHeap {
|
||||
|
||||
/* 构造函数,根据输入列表建堆 */
|
||||
public MaxHeap(List<Integer> nums) {
|
||||
// 所有元素入堆
|
||||
// 将列表元素原封不动添加进堆
|
||||
maxHeap = new ArrayList<>(nums);
|
||||
// 堆化除叶结点以外的其他所有结点
|
||||
for (int i = parent(size() - 1); i >= 0; i--) {
|
||||
|
||||
Reference in New Issue
Block a user