We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b21444d commit 85771eaCopy full SHA for 85771ea
Searches/BinarySearch.java
@@ -23,7 +23,7 @@ public static <T extends Comparable<T>> int BS(T array[], T key, int lb, int ub)
23
if ( lb > ub)
24
return -1;
25
26
- int mid = (ub+lb)/2;
+ int mid = (ub+lb) >>> 1;
27
int comp = key.compareTo(array[mid]);
28
29
if (comp < 0)
0 commit comments