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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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