From 183784b9892e7ed5c16447cf3b9714e3713fd644 Mon Sep 17 00:00:00 2001 From: kbrx93 Date: Sun, 14 Mar 2021 09:38:57 +0800 Subject: [PATCH] Fixes the sort order (#2142) --- Sorts/SelectionSort.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sorts/SelectionSort.java b/Sorts/SelectionSort.java index 5b850dd33..90f852df9 100644 --- a/Sorts/SelectionSort.java +++ b/Sorts/SelectionSort.java @@ -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; } }