mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 16:54:50 +08:00
Update 0704.二分查找.md
This commit is contained in:
@ -516,7 +516,7 @@ impl Solution {
|
|||||||
|
|
||||||
**C:**
|
**C:**
|
||||||
```c
|
```c
|
||||||
## (版本一) 左闭右闭区间 [left, right]
|
// (版本一) 左闭右闭区间 [left, right]
|
||||||
int search(int* nums, int numsSize, int target){
|
int search(int* nums, int numsSize, int target){
|
||||||
int left = 0;
|
int left = 0;
|
||||||
int right = numsSize-1;
|
int right = numsSize-1;
|
||||||
@ -543,7 +543,7 @@ int search(int* nums, int numsSize, int target){
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
```C
|
```C
|
||||||
##(版本二) 左闭右开区间 [left, right)
|
// (版本二) 左闭右开区间 [left, right)
|
||||||
int search(int* nums, int numsSize, int target){
|
int search(int* nums, int numsSize, int target){
|
||||||
int length = numsSize;
|
int length = numsSize;
|
||||||
int left = 0;
|
int left = 0;
|
||||||
|
Reference in New Issue
Block a user