Add the return value in create _heap()

This commit is contained in:
stepfencurryxiao 2020-04-20 18:34:28 +08:00
parent 457fbf9b6f
commit e6d1bd9d2a
2 changed files with 2 additions and 0 deletions

View File

@ -46,6 +46,7 @@ Heap* create_heap(Heap* heap){
heap->size = 1; heap->size = 1;
heap->p = (int *)malloc(heap->size*sizeof(int)); heap->p = (int *)malloc(heap->size*sizeof(int));
heap->count = 0; heap->count = 0;
return heap;
} }
void down_heapify(Heap* heap, int index){ void down_heapify(Heap* heap, int index){

View File

@ -46,6 +46,7 @@ Heap* create_heap(Heap* heap){
heap->size = 1; heap->size = 1;
heap->p = (int *)malloc(heap->size*sizeof(int)); heap->p = (int *)malloc(heap->size*sizeof(int));
heap->count = 0; heap->count = 0;
return heap;
} }
void down_heapify(Heap* heap, int index){ void down_heapify(Heap* heap, int index){