Skip to content

Commit 89dcd4e

Browse files
authored
Update binary-search.md
1 parent b7bb7b0 commit 89dcd4e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

91/binary-search.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,11 @@ public class BinarySearch {
553553
int low=0,high=A.lenght-1;
554554
while (low <= high){
555555
int mid = (low + high)/2;
556-
if (A[mid] >= val){
556+
if (A[mid] >= val) {
557557
high = mid-1;
558-
}else low = mid+1;
558+
} else {
559+
low = mid+1;
560+
}
559561
}
560562
return low;
561563
}

0 commit comments

Comments
 (0)