September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -4,7 +4,7 @@ public class BinarySearchIterative {
|
|||
int hi = nums.length - 1;
|
||||
int lo = 0;
|
||||
while (hi >= lo) {
|
||||
int guess = lo + ((hi - lo) / 2);
|
||||
int guess = (lo + hi) >>> 1; // from OpenJDK
|
||||
if (nums[guess] > check) {
|
||||
hi = guess - 1;
|
||||
} else if (nums[guess] < check) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue