Skip to content

Commit ec8d670

Browse files
authored
Update heap_sort.c
1 parent 60a69ec commit ec8d670

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sorting/heap_sort.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
void max_heapify(int *a, int i, int n);
99
void heapsort(int *a, int n);
1010
void build_maxheap(int *a, int n);
11-
11+
/**
12+
* max_heapify takes O(logn).
13+
*/
1214
void max_heapify(int *a, int i, int n)
1315
{
1416
int j, temp;
@@ -43,7 +45,9 @@ void heapsort(int *a, int n)
4345
max_heapify(a, 1, i - 1);
4446
}
4547
}
46-
48+
/**
49+
* build_maxheap takes O(n).
50+
*/
4751
void build_maxheap(int *a, int n)
4852
{
4953
int i;

0 commit comments

Comments
 (0)