Skip to content

Commit

Permalink
update cheatsheet binary_search.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yennanliu committed Oct 2, 2024
1 parent 6bc1f1a commit ef83d46
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions doc/cheatsheet/binary_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,25 +135,6 @@ def binary_search(nums, target):
return -1
```

```c++
// c++
int binarySearch(int[] nums, int target) {
int left = 0, right = ...;

while(...) {
int mid = left + (right - left) / 2;
if (nums[mid] == target) {
...
} else if (nums[mid] < target) {
left = ...
} else if (nums[mid] > target) {
right = ...
}
}
return ...;
}
```
#### 0-2-1) Binary search on `LEFT` boundary
```python
# python
Expand Down

0 comments on commit ef83d46

Please sign in to comment.