Fixes the sort order (#2142)

This commit is contained in:
kbrx93
2021-03-14 09:38:57 +08:00
committed by GitHub
parent 424b0fd11b
commit 183784b989

View File

@ -32,7 +32,7 @@ public class SelectionSort implements SortAlgorithm {
int min = i;
for (int j = i + 1; j < n; j++) {
if (arr[min].compareTo(arr[j]) < 0) {
if (arr[min].compareTo(arr[j]) > 0) {
min = j;
}
}