From e6d1bd9d2a5205352de4ece40dbe28d4bd5d505d Mon Sep 17 00:00:00 2001 From: stepfencurryxiao Date: Mon, 20 Apr 2020 18:34:28 +0800 Subject: [PATCH] Add the return value in create _heap() --- data_structures/heap/max_heap.c | 1 + data_structures/heap/min_heap.c | 1 + 2 files changed, 2 insertions(+) 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){