Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ed2106f

Browse files
authored
Update Binary_Search_Variants.java
1 parent 48f7130 commit ed2106f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎BinarySearch/Binary_Search_Variants.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public int lastOccurrenceLesserThanKey(int arr[],int target){
150150
while(low<=high){
151151
int mid = low + (high-low+1)/2;
152152
if(arr[mid] < target){
153-
ans = mid;
153+
result = mid;
154154
low = mid + 1; //to find last index push right
155155
}
156156
else if(arr[mid] > target){

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /