mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-26 22:14:08 +08:00
Remove unnecessary code (#4141)
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
package com.thealgorithms.searches;
|
||||
|
||||
import static java.lang.String.format;
|
||||
|
||||
import com.thealgorithms.devutils.searches.SearchAlgorithm;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
@ -48,24 +46,16 @@ class LowerBound implements SearchAlgorithm {
|
||||
LowerBound search = new LowerBound();
|
||||
int atIndex = search.find(integers, val);
|
||||
|
||||
System.out.println(
|
||||
format(
|
||||
"Val: %d. Lower Bound Found %d at index %d. An array length %d",
|
||||
System.out.printf(
|
||||
"Val: %d. Lower Bound Found %d at index %d. An array length %d%n",
|
||||
val,
|
||||
integers[atIndex],
|
||||
atIndex,
|
||||
size
|
||||
)
|
||||
);
|
||||
|
||||
boolean toCheck = integers[atIndex] >= val || integers[size - 1] < val;
|
||||
System.out.println(
|
||||
format(
|
||||
"Lower Bound found at an index: %d. Is greater or max element: %b",
|
||||
atIndex,
|
||||
toCheck
|
||||
)
|
||||
);
|
||||
System.out.printf("Lower Bound found at an index: %d. Is greater or max element: %b%n", atIndex, toCheck);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user