mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
Update heap_sort.c
This commit is contained in:
parent
8de917de6e
commit
2ebc98620c
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user