Update heap_sort.c

This commit is contained in:
Shezza221b 2020-10-01 04:28:23 +05:30 committed by GitHub
parent 18ee0c1546
commit 8de917de6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@
void max_heapify(int *a, int i, int n); void max_heapify(int *a, int i, int n);
void heapsort(int *a, int n); void heapsort(int *a, int n);
void build_maxheap(int *a, int n); void build_maxheap(int *a, int n);
/** /**
* max_heapify takes O(logn). * max_heapify takes O(logn).
*/ */
@ -40,6 +41,7 @@ void heapsort(int *a, int n)
max_heapify(a, 1, i - 1); max_heapify(a, 1, i - 1);
} }
} }
/** /**
* build_maxheap takes O(n). * build_maxheap takes O(n).
*/ */