We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef625ec commit 4e676f4Copy full SHA for 4e676f4
docs/notes/Leetcode 题解 - 二分查找.md
@@ -59,7 +59,7 @@ l + h 可能出现加法溢出,也就是说加法的结果大于整型能够
59
60
```java
61
public int binarySearch(int[] nums, int key) {
62
- int l = 0, h = nums.length - 1;
+ int l = 0, h = nums.length;
63
while (l < h) {
64
int m = l + (h - l) / 2;
65
if (nums[m] >= key) {
notes/Leetcode 题解 - 二分查找.md
0 commit comments