aboutsummaryrefslogtreecommitdiff
path: root/heap.c
diff options
context:
space:
mode:
Diffstat (limited to 'heap.c')
-rw-r--r--heap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/heap.c b/heap.c
index 3e354c4..e2ca750 100644
--- a/heap.c
+++ b/heap.c
@@ -116,9 +116,9 @@ my_heapsort(T a[], size_t n)
116{ 116{
117 heapify(a, n); 117 heapify(a, n);
118 118
119 for ( size_t i = n; i-- > 0; ) { 119 while ( n-- ) {
120 swap(a, 0, i); 120 swap(a, 0, n);
121 fixdown(a, 0, i); 121 fixdown(a, 0, n);
122 } 122 }
123} 123}
124 124