diff --git a/src/main/java/com/sorts/SortUtils.java b/src/main/java/com/sorts/SortUtils.java index cbede545..23bf0336 100644 --- a/src/main/java/com/sorts/SortUtils.java +++ b/src/main/java/com/sorts/SortUtils.java @@ -38,7 +38,7 @@ final class SortUtils { * @param right is a right flip border of the array */ static > void flip(T[] array, int left, int right) { - while (left <= right) { + while (left < right) { swap(array, left++, right--); } }