From 3a76b3a85e097446ab5f9e7dbb6028bac81c75de Mon Sep 17 00:00:00 2001
From: jinbudaily <18336218010@163.com>
Date: Mon, 17 Jul 2023 11:52:50 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=200704.=E4=BA=8C?=
=?UTF-8?q?=E5=88=86=E6=9F=A5=E6=89=BE=20=E6=8E=92=E7=89=88=E6=A0=BC?=
=?UTF-8?q?=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
problems/0704.二分查找.md | 36 +++++++++++++++++++----------------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/problems/0704.二分查找.md b/problems/0704.二分查找.md
index c59ae868..d202dfa1 100644
--- a/problems/0704.二分查找.md
+++ b/problems/0704.二分查找.md
@@ -35,7 +35,7 @@
## 算法公开课
-***[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[手把手带你撕出正确的二分法](https://www.bilibili.com/video/BV1fA4y1o715),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[手把手带你撕出正确的二分法](https://www.bilibili.com/video/BV1fA4y1o715),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@@ -160,7 +160,7 @@ public:
## 其他语言版本
-**Java:**
+### **Java:**
(版本一)左闭右闭区间
@@ -206,7 +206,7 @@ class Solution {
}
```
-**Python:**
+### **Python:**
(版本一)左闭右闭区间
@@ -246,7 +246,7 @@ class Solution:
return -1 # 未找到目标值
```
-**Go:**
+### **Go:**
(版本一)左闭右闭区间
@@ -288,7 +288,7 @@ func search(nums []int, target int) int {
}
```
-**JavaScript:**
+### **JavaScript:**
(版本一)左闭右闭区间 [left, right]
```js
@@ -345,7 +345,7 @@ var search = function(nums, target) {
};
```
-**TypeScript**
+### **TypeScript**
(版本一)左闭右闭区间
@@ -387,7 +387,7 @@ function search(nums: number[], target: number): number {
};
```
-**Ruby:**
+### **Ruby:**
```ruby
# (版本一)左闭右闭区间
@@ -425,7 +425,7 @@ def search(nums, target)
end
```
-**Swift:**
+### **Swift:**
```swift
// (版本一)左闭右闭区间
@@ -479,7 +479,7 @@ func search(nums: [Int], target: Int) -> Int {
```
-**Rust:**
+### **Rust:**
```rust
# (版本一)左闭右闭区间
@@ -523,7 +523,8 @@ impl Solution {
}
```
-**C:**
+### **C:**
+
```c
// (版本一) 左闭右闭区间 [left, right]
int search(int* nums, int numsSize, int target){
@@ -575,7 +576,8 @@ int search(int* nums, int numsSize, int target){
}
```
-**PHP:**
+### **PHP:**
+
```php
// 左闭右闭区间
class Solution {
@@ -607,7 +609,8 @@ class Solution {
}
```
-**C#:**
+### **C#:**
+
```csharp
//左闭右闭
public class Solution {
@@ -652,7 +655,8 @@ public class Solution{
}
```
-**Kotlin:**
+### **Kotlin:**
+
```kotlin
class Solution {
fun search(nums: IntArray, target: Int): Int {
@@ -682,9 +686,8 @@ class Solution {
}
```
+### **Kotlin:**
-
-**Kotlin:**
```Kotlin
// (版本一)左闭右开区间
class Solution {
@@ -715,7 +718,7 @@ class Solution {
}
}
```
-**Scala:**
+### **Scala:**
(版本一)左闭右闭区间
```scala
@@ -763,3 +766,4 @@ object Solution {
+
From 948aca860da277d744c9fb130039fe96dd79491f Mon Sep 17 00:00:00 2001
From: jinbudaily <18336218010@163.com>
Date: Mon, 17 Jul 2023 14:59:20 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=200704.=E4=BA=8C?=
=?UTF-8?q?=E5=88=86=E6=9F=A5=E6=89=BE=20=E6=8E=92=E7=89=88=E6=A0=BC?=
=?UTF-8?q?=E5=BC=8F=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
problems/0704.二分查找.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/problems/0704.二分查找.md b/problems/0704.二分查找.md
index d202dfa1..52abf578 100644
--- a/problems/0704.二分查找.md
+++ b/problems/0704.二分查找.md
@@ -5,7 +5,7 @@
参与本项目,贡献其他语言版本的代码,拥抱开源,让更多学习算法的小伙伴们收益!
-## 704. 二分查找 +# 704. 二分查找 [力扣题目链接](https://leetcode.cn/problems/binary-search/) @@ -766,4 +766,3 @@ object Solution {