File tree 1 file changed +5
-5
lines changed
src/main/java/com/thealgorithms/sorts
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ public <T extends Comparable<T>> T[] sort(T[] array) {
14
14
return array ;
15
15
}
16
16
17
- for (int currentSize = 0 ; currentSize < array .length ; currentSize ++) {
17
+ for (int currentSize = 0 ; currentSize < array .length ; currentSize ++) {
18
18
int maxIndex = findMaxIndex (array , currentSize );
19
- SortUtils .flip (array , maxIndex , array .length - 1 - currentSize );
19
+ SortUtils .flip (array , maxIndex , array .length - 1 - currentSize );
20
20
}
21
21
22
22
return array ;
@@ -32,13 +32,13 @@ public <T extends Comparable<T>> T[] sort(T[] array) {
32
32
*/
33
33
private <T extends Comparable <T >> int findMaxIndex (T [] array , int currentSize ) {
34
34
T max = array [0 ];
35
- int maxIndex = 0 ;
35
+ int maxIndex = 0 ;
36
36
for (int i = 0 ; i < array .length - currentSize ; i ++) {
37
37
if (SortUtils .less (max , array [i ])) {
38
38
max = array [i ];
39
- maxIndex = i ;
39
+ maxIndex = i ;
40
40
}
41
41
}
42
- return maxIndex ;
42
+ return maxIndex ;
43
43
}
44
44
}
You can’t perform that action at this time.
0 commit comments