Skip to content
Snippets Groups Projects
Commit 5bc5a643 authored by malric litiere's avatar malric litiere
Browse files

avant push

parent 7c4e1807
Branches
No related merge requests found
Projet/Graphe_general.png

146 KiB

......@@ -3,7 +3,7 @@
affichage=0
#taille=100
echo -e "iTest\ttaille\ttemps\tmem\talgo\ttypeTableau"
echo -e "iTest\ttaille\ttemps\tmem\talgo\t"
for iTest in `seq 1 10`
do
......
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include "tri_cocktail.h"
void triCocktail(long* A, size_t n){
size_t permutation;
size_t en_cours=0, sens=1;
size_t debut=1, fin=n-1;
do{
permutation =0;
while(((sens==1)&& (en_cour<fin)) || ((sens==-1)&&(en_cours>debut))){
en_cour += sens;
if(A[en_cours]<A[encours-1]){
long temp = A[en_cours];
A[en_cours]=A[encours-1];
A[en_cours-1]= temp;
permutation = 1;
}
}
if(sens==1) fin--; else debut ++;
sens = -sens;
}while(permutation = 1);
}
\ No newline at end of file
#ifndef TRIS_I
#define TRIS_I
#include <stdint.h>
#include <stdlib.h>
void triCocktail(long* A, size_t n);
#endif //TRIS_C
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment