Skip to content

Commit

Permalink
Fix the issue of discusscomment 7938404 (#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
night-cruise authored Dec 26, 2023
1 parent 774c27c commit 1ee0a7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codes/rust/chapter_searching/binary_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn binary_search_lcro(nums: &[i32], target: i32) -> i32 {
if nums[m as usize] < target { // 此情况说明 target 在区间 [m+1, j) 中
i = m + 1;
} else if nums[m as usize] > target { // 此情况说明 target 在区间 [i, m) 中
j = m - 1;
j = m;
} else { // 找到目标元素,返回其索引
return m;
}
Expand Down

0 comments on commit 1ee0a7a

Please sign in to comment.