From 60a69ecf5821db9336dc9d9b332a7ac7ae7f5117 Mon Sep 17 00:00:00 2001 From: Shezza221b <41204318+Shezza221b@users.noreply.github.com> Date: Thu, 1 Oct 2020 01:44:53 +0530 Subject: [PATCH] Update heap_sort.c Added time complexities of functions used. --- sorting/heap_sort.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sorting/heap_sort.c b/sorting/heap_sort.c index d4c2a563..b5084cc1 100644 --- a/sorting/heap_sort.c +++ b/sorting/heap_sort.c @@ -1,3 +1,8 @@ +/** + * max_heapify takes O(logn). + * build_maxheap takes O(n). + * heapsort takes O(nlogn) since it requires above mentioned functions. + */ #include void max_heapify(int *a, int i, int n);