forked from menault/TD1_DEV51_Qualite_Algo
Multijoueur
This commit is contained in:
@@ -14,8 +14,12 @@ void bubblesort(int* array, int length)
|
||||
tmp = array[i-1];
|
||||
array[i-1] = array[i];
|
||||
array[i] = tmp;
|
||||
swapped++;
|
||||
swapped=1;
|
||||
}
|
||||
}
|
||||
} while(swapped==1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
13
compte_rendue.md
Normal file
13
compte_rendue.md
Normal file
@@ -0,0 +1,13 @@
|
||||
on s'est rendu compte que bubblesort et find_rank_student font enormement d'appel et qu'il prenne tous autant de temps
|
||||
on va donc regarder leurs codes et voir ce qui peut etre optimiser
|
||||
|
||||
ps : le code est pas commenter j'aime pas (Maxime Lebreton)
|
||||
pps : Ouais j'suis d'accord avec mon camarade ci-dessus, la prochaine fois faite des faux commentaires pour nous rendre encore plus confus. (Marvin Aubert)
|
||||
|
||||
il y avait 2 appel de bubblesort j'ai retirer le mauvais donc le temps n'étais pas gagné après la suppression du bon le code est bien plus rapide
|
||||
|
||||
|
||||
|
||||
|
||||
Maxime LEBRETON
|
||||
Marvin AUBERT
|
BIN
student_rank
Executable file
BIN
student_rank
Executable file
Binary file not shown.
@@ -55,7 +55,6 @@ int find_rank_student(int student_grade, int* grades_array, int students_number)
|
||||
{
|
||||
int position = -1;
|
||||
int i = 0;
|
||||
bubblesort(grades_array,students_number);
|
||||
for(i = students_number-1; i >= 0; i--)
|
||||
{
|
||||
if(grades_array[i] == student_grade)
|
||||
@@ -77,7 +76,7 @@ void sort_students(int** students_rank, int** students_array, int students_numbe
|
||||
{
|
||||
grades[j] = students_array[j][i];
|
||||
}
|
||||
bubblesort(grades,students_number);
|
||||
bubblesort(grades,students_number);
|
||||
for(j = 0; j < students_number; j++)
|
||||
{
|
||||
students_rank[j][i] = find_rank_student(students_array[j][i],grades,students_number);
|
||||
|
Reference in New Issue
Block a user