Compare commits

..

No commits in common. "main" and "main" have entirely different histories.
main ... main

6 changed files with 12 additions and 731 deletions

File diff suppressed because it is too large Load Diff

BIN
gmon.out

Binary file not shown.

BIN
out2.txt

Binary file not shown.

BIN
out3.txt

Binary file not shown.

View File

@ -55,7 +55,7 @@ int find_rank_student(int student_grade, int* grades_array, int students_number)
{
int position = -1;
int i = 0;
/*bubblesort(grades_array,students_number);*/
bubblesort(grades_array,students_number);
for(i = students_number-1; i >= 0; i--)
{
if(grades_array[i] == student_grade)
@ -66,27 +66,23 @@ int find_rank_student(int student_grade, int* grades_array, int students_number)
}
return position;
}
/* !!!!!
students_number arg 1
grades_number arg 2
*/
void sort_students(int** students_rank, int** students_array, int students_number, int grades_number)
{
int i = 0, j = 0;
for(i = 0; i < grades_number; i++)
{
int * grades = (int*) malloc(students_number*sizeof(int));
for(j = 0; j < students_number; j++)
{
grades[j] = students_array[j][i];
}
//bubblesort(grades,students_number);
heapsort(grades,students_number);
for(j = 0; j < students_number; j++)
{
for(j = 0; j < students_number; j++)
{
grades[j] = students_array[j][i];
}
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);
}
free(grades);
}
free(grades);
}
}
@ -112,7 +108,7 @@ int main(int argc, char** argv)
generate_grades(student_grades,students_length,grades_length);
generate_ranks(student_ranks,students_length,grades_length);
sort_students(student_ranks,student_grades,students_length,grades_length); /*!!!!!!*/
sort_students(student_ranks,student_grades,students_length,grades_length);
if(debug_mode)
{

Binary file not shown.