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);