Fine tune the C codes.

This commit is contained in:
krahets
2023-04-17 22:15:06 +08:00
parent c4ea4e39f3
commit af0f92c18d
15 changed files with 29 additions and 103 deletions

View File

@@ -75,7 +75,7 @@ void push(maxHeap *h, int val) {
// 默认情况下,不应该添加这么多节点
if (h->size == MAX_SIZE) {
printf("heap is full!");
return NIL;
return;
}
// 添加节点
h->data[h->size] = val;
@@ -174,4 +174,6 @@ int main() {
// 释放内存
free(heap);
return 0;
}