mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-08 10:15:51 +08:00
Fixes the sort order (#2142)
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user