Skip to content
Snippets Groups Projects
tris.c 293 B
Newer Older
#include "tris.h"
#include <math.h>
#include <stdlib.h>

void triInsertion(int* A, int n){
malric litiere's avatar
malric litiere committed
    for(int i = 1; i <= n-1; i++){
        int cle = A[i];
        int j = i - 1;
        while(j >= 0 && A[j] > cle){
malric litiere's avatar
malric litiere committed
            A[j+1] = A[j];
            j--;
malric litiere's avatar
malric litiere committed
        }
        A[j+1] = cle;
malric litiere's avatar
malric litiere committed
    }
}