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