Remove unnecessary code (#4141)

This commit is contained in:
Saurabh Rahate
2023-04-03 20:05:59 +05:30
committed by GitHub
parent 805f09850c
commit ad72c28d91
64 changed files with 125 additions and 322 deletions

View File

@ -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);
}
/**