Skip to content
Snippets Groups Projects
Commit 1d334031 authored by lucas.toniutti's avatar lucas.toniutti
Browse files

Ajout du tri a bulle

parent 5e5a7435
No related branches found
No related tags found
No related merge requests found
File added
main.o 0 → 100644
File added
......@@ -6,17 +6,16 @@
void triBulle(int32_t sorted[], const int32_t *const orig, int32_t nitems, bool (*comp)(int32_t, int32_t)){
copierTableau(sorted, orig, nitems);
int tmp;
for(int i=0; i < nitems-1; i++){
for(int j=0; i < (nitems-i-1); j++){
for(int i=nitems-1; i >= 1; i--){
for(int j=0; j <= i-1; j++){
//Décroissant <
if (sorted[j] > sorted[j+1]){
if (sorted[j] < sorted[j+1]){
tmp = sorted[j];
sorted[j] = sorted[j+1];
sorted[j+1] = tmp;
}
}
}
}
void triRapide(int32_t sorted[], const int32_t *const orig, int32_t nitems, bool (*comp)(int32_t, int32_t)){
......
tri.o 0 → 100644
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment