diff --git a/data_structures/heap/max_heap.c b/data_structures/heap/max_heap.c index bd4a82b28..f529a7ac6 100644 --- a/data_structures/heap/max_heap.c +++ b/data_structures/heap/max_heap.c @@ -46,6 +46,7 @@ Heap* create_heap(Heap* heap){ heap->size = 1; heap->p = (int *)malloc(heap->size*sizeof(int)); heap->count = 0; + return heap; } void down_heapify(Heap* heap, int index){ diff --git a/data_structures/heap/min_heap.c b/data_structures/heap/min_heap.c index 91c4b6ae5..066f9a112 100644 --- a/data_structures/heap/min_heap.c +++ b/data_structures/heap/min_heap.c @@ -46,6 +46,7 @@ Heap* create_heap(Heap* heap){ heap->size = 1; heap->p = (int *)malloc(heap->size*sizeof(int)); heap->count = 0; + return heap; } void down_heapify(Heap* heap, int index){