I tried my best to figure it out, but even though I put an hour, I couldn't fix it... plz help. I am pretty sure my second for loop is wrong, I tried everything that I knew, but it was giving me wrong answers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
void sort(string destination[], int low, int high) {
int i;
int j;
int smallest;
string temp;
for ( i = low; i <= high; i++) {
smallest = i;
for (j = i; j <= high; j++) {
if (destination[j] > destination[smallest]) {
smallest = j;
}
}
temp = destination[smallest];
destination[smallest] = destination[i];
destination[i] = temp;
}
return ;
}