Skip to content

Commit ab522e8

Browse files
committed
Fix formatting: remove extra blank lines to pass clang linter
1 parent 6123598 commit ab522e8

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/main/java/com/thealgorithms/searches/IterativeBinarySearch.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public final class IterativeBinarySearch implements SearchAlgorithm {
3333
*/
3434
@Override
3535
public <T extends Comparable<T>> int find(T[] array, T key) {
36-
3736
// Handle edge cases: null/empty array or null key
3837
// Prevents NullPointerException during comparison
3938
if (array == null || array.length == 0 || key == null) {
@@ -44,11 +43,9 @@ public <T extends Comparable<T>> int find(T[] array, T key) {
4443
int right = array.length - 1;
4544

4645
while (left <= right) {
47-
4846
// Use unsigned right shift to avoid overflow
4947
// Equivalent to (left + right) / 2 but safer for large indices
5048
int mid = (left + right) >>> 1;
51-
5249
int cmp = key.compareTo(array[mid]);
5350

5451
if (cmp == 0) {

0 commit comments

Comments
 (0)