Skip to content

Commit 60a69ec

Browse files
authored
Update heap_sort.c
Added time complexities of functions used.
1 parent 544f492 commit 60a69ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sorting/heap_sort.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* max_heapify takes O(logn).
3+
* build_maxheap takes O(n).
4+
* heapsort takes O(nlogn) since it requires above mentioned functions.
5+
*/
16
#include <stdio.h>
27

38
void max_heapify(int *a, int i, int n);

0 commit comments

Comments
 (0)