Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit183784b

Browse files
authored
Fixes the sort order (TheAlgorithms#2142)
1 parent424b0fd commit183784b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎Sorts/SelectionSort.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public <T extends Comparable<T>> T[] sort(T[] arr) {
3232
intmin =i;
3333

3434
for (intj =i +1;j <n;j++) {
35-
if (arr[min].compareTo(arr[j])<0) {
35+
if (arr[min].compareTo(arr[j])>0) {
3636
min =j;
3737
}
3838
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp