Skip to content

Commit f3f2661

Browse files
author
MK
committed
Solve the Optimize method flip in SortUtils TheAlgorithms#1246
1 parent d678fae commit f3f2661

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/sorts/SortUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static <T extends Comparable<T>> boolean less(T v, T w) {
3838
* @param right is a right flip border of the array
3939
*/
4040
static <T extends Comparable<T>> void flip(T[] array, int left, int right) {
41-
while (left <= right) {
41+
while (left < right) {
4242
swap(array, left++, right--);
4343
}
4444
}

0 commit comments

Comments
 (0)