this is what i have to sort grades...
public static void sortSelection(int grades[]){
for (int i = 0; i < grades.length -1; i++){
int largest = i;
for (int c = largest + 1; c < grades.length; c++)
if (grades[c]> grades[largest]) largest = c;
int temp = grades[largest];
grades[largest]= grades;
grades= temp;
}
}
i need to use the same kind of format but instead alphabetize the names...
public static void sortSelection(int grades[]){
for (int i = 0; i < grades.length -1; i++){
int largest = i;
for (int c = largest + 1; c < grades.length; c++)
if (grades[c]> grades[largest]) largest = c;
int temp = grades[largest];
grades[largest]= grades;
grades= temp;
}
}
i need to use the same kind of format but instead alphabetize the names...