Skip to content

Commit

Permalink
Update binary-search.md
Browse files Browse the repository at this point in the history
  • Loading branch information
azl397985856 authored Sep 17, 2022
1 parent 89dcd4e commit a0ebb76
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions 91/binary-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,11 @@ public class BinarySearch {
int low=0,high=A.lenght-1;
while (low <= high){
int mid = (low + high)/2;
if (A[mid] <= val){
if (A[mid] <= val) {
low = mid + 1;
}else high = mid - 1;
} else {
high = mid - 1;
}
}
return low;
}
Expand Down

0 comments on commit a0ebb76

Please sign in to comment.