This commit is contained in:
2025-09-10 17:24:19 +02:00
parent ca552281c9
commit ef135a95e0
6 changed files with 15 additions and 13 deletions

View File

@@ -1,5 +1,4 @@
// Heapsort Algorithm
// M.Menault 2024
#include <stdio.h>
#include <stdlib.h>
@@ -47,13 +46,12 @@ void heapsort(int* array, int length)
{
int i = 0;
int temp_value = 0;
// Sift the current array (binary tree)
for(i=(length/2); i >= 0; i--)
{
sift(array,i,length);
}
// Heapsort !
for(i=length-1; i > 0; i--)
{
temp_value = array[i];