mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-26 11:32:31 +08:00
build
This commit is contained in:
@@ -176,7 +176,7 @@ comments: true
|
||||
maxHeap *h = (maxHeap *)malloc(sizeof(maxHeap));
|
||||
h->size = size;
|
||||
memcpy(h->data, nums, size * sizeof(int));
|
||||
for (int i = parent(size - 1); i >= 0; i--) {
|
||||
for (int i = parent(h, size - 1); i >= 0; i--) {
|
||||
// 堆化除叶节点以外的其他所有节点
|
||||
siftDown(h, i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user