Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sorting/heap_sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ void max_heapify(int *a, int i, int n);
void heapsort(int *a, int n);
void build_maxheap(int *a, int n);

/**
* max_heapify takes O(logn).
*/
void max_heapify(int *a, int i, int n)
{
int j, temp;
Expand Down Expand Up @@ -39,6 +42,9 @@ void heapsort(int *a, int n)
}
}

/**
* build_maxheap takes O(n).
*/
void build_maxheap(int *a, int n)
{
int i;
Expand Down