Update heap_sort.c

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

View File

@ -6,6 +6,10 @@ void build_maxheap(int *a, int n);
/**
* max_heapify takes O(logn).
* @param a pointer to array a containing heap elements.
* @param i element at which max_heapify needs to be performed.
* @param n where n is number of elemnts in array a.
* @returns void.
*/
void max_heapify(int *a, int i, int n)
{
@ -44,6 +48,9 @@ void heapsort(int *a, int n)
/**
* build_maxheap takes O(n).
* @param a pointer to array a containing heap elements.
* @param n where n is number of elemnts in array a.
* @returns void.
*/
void build_maxheap(int *a, int n)
{