Skip to content

Commit bdd8085

Browse files
committed
Removed excess parenthesis
1 parent f38b181 commit bdd8085

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/main/java/com/thealgorithms/sorts/BitonicSort.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private <T extends Comparable<T>> void bitonicMerge(T[] array, int low, int cnt,
6464
if (cnt > 1) {
6565
final int k = cnt / 2;
6666

67-
final BiPredicate<T, T> areSorted = (direction == Direction.ASCENDING) ? (a, b) -> (SortUtils.less(a, b)) : (a, b) -> (SortUtils.greater(a, b));
67+
final BiPredicate<T, T> areSorted = (direction == Direction.ASCENDING) ? (a, b) -> SortUtils.less(a, b) : (a, b) -> SortUtils.greater(a, b);
6868
for (int i = low; i < low + k; i++) {
6969
if (!areSorted.test(array[i], array[i + k])) {
7070
SortUtils.swap(array, i, i + k);

src/main/java/com/thealgorithms/sorts/CircleSort.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private <T extends Comparable<T>> boolean doSort(final T[] array, final int left
4444
high--;
4545
}
4646

47-
if (low == high && (SortUtils.greater(array[low], array[high + 1]))) {
47+
if (low == high && SortUtils.greater(array[low], array[high + 1])) {
4848
SortUtils.swap(array, low, high + 1);
4949
swapped = true;
5050
}

src/main/java/com/thealgorithms/sorts/IntrospectiveSort.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private static <T extends Comparable<T>> void insertionSort(T[] array, final int
8484
for (int i = low + 1; i <= high; i++) {
8585
final T key = array[i];
8686
int j = i - 1;
87-
while (j >= low && (SortUtils.greater(array[j], key))) {
87+
while (j >= low && SortUtils.greater(array[j], key)) {
8888
array[j + 1] = array[j];
8989
j--;
9090
}
@@ -125,10 +125,10 @@ private static <T extends Comparable<T>> void heapify(T[] array, final int i, fi
125125
final int right = 2 * i + 2;
126126
int largest = i;
127127

128-
if (left < n && (SortUtils.greater(array[low + left], array[low + largest]))) {
128+
if (left < n && SortUtils.greater(array[low + left], array[low + largest])) {
129129
largest = left;
130130
}
131-
if (right < n && (SortUtils.greater(array[low + right], array[low + largest]))) {
131+
if (right < n && SortUtils.greater(array[low + right], array[low + largest])) {
132132
largest = right;
133133
}
134134
if (largest != i) {

src/main/java/com/thealgorithms/sorts/SelectionSortRecursive.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ private static <T extends Comparable<T>> int findMinIndex(T[] array, final int s
5656
final int minIndexInRest = findMinIndex(array, start + 1);
5757

5858
// Return the index of the smaller element between array[start] and the minimum element in the rest of the array
59-
return (SortUtils.less(array[start], array[minIndexInRest])) ? start : minIndexInRest;
59+
return SortUtils.less(array[start], array[minIndexInRest]) ? start : minIndexInRest;
6060
}
6161
}

0 commit comments

Comments
 (0)