Add Swift language blocks to the docs.

This commit is contained in:
Yudong Jin
2023-01-08 19:41:05 +08:00
parent 3ba37dba3a
commit 73e3452838
22 changed files with 414 additions and 70 deletions
+12
View File
@@ -122,6 +122,12 @@ comments: true
```
=== "Swift"
```swift title="linear_search.swift"
```
再比如,我们想要在给定一个目标结点值 `target` ,返回此结点对象,也可以在链表中进行线性查找。
=== "Java"
@@ -238,6 +244,12 @@ comments: true
}
```
=== "Swift"
```swift title="linear_search.swift"
```
## 复杂度分析
**时间复杂度 $O(n)$ ** 其中 $n$ 为数组或链表长度。