mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-29 19:37:14 +00:00
Add Swift language blocks to the docs.
This commit is contained in:
@@ -95,6 +95,12 @@ comments: true
|
||||
}
|
||||
```
|
||||
|
||||
=== "Swift"
|
||||
|
||||
```swift title="hashing_search.swift"
|
||||
|
||||
```
|
||||
|
||||
再比如,如果我们想要给定一个目标结点值 `target` ,获取对应的链表结点对象,那么也可以使用哈希查找实现。
|
||||
|
||||

|
||||
@@ -179,6 +185,12 @@ comments: true
|
||||
}
|
||||
```
|
||||
|
||||
=== "Swift"
|
||||
|
||||
```swift title="hashing_search.swift"
|
||||
|
||||
```
|
||||
|
||||
## 复杂度分析
|
||||
|
||||
**时间复杂度:** $O(1)$ ,哈希表的查找操作使用 $O(1)$ 时间。
|
||||
|
||||
Reference in New Issue
Block a user