mirror of
https://github.com/krahets/hello-algo.git
synced 2026-05-01 22:12:01 +08:00
Release Rust code to documents. (#656)
This commit is contained in:
@@ -97,6 +97,12 @@
|
||||
[class]{HashMapChaining}-[func]{}
|
||||
```
|
||||
|
||||
=== "Rust"
|
||||
|
||||
```rust title="hash_map_chaining.rs"
|
||||
[class]{HashMapChaining}-[func]{}
|
||||
```
|
||||
|
||||
!!! tip
|
||||
|
||||
当链表很长时,查询效率 $O(n)$ 很差,**此时可以将链表转换为「AVL 树」或「红黑树」**,从而将查询操作的时间复杂度优化至 $O(\log n)$ 。
|
||||
@@ -190,6 +196,12 @@
|
||||
[class]{HashMapOpenAddressing}-[func]{}
|
||||
```
|
||||
|
||||
=== "Rust"
|
||||
|
||||
```rust title="hash_map_open_addressing.rs"
|
||||
[class]{HashMapOpenAddressing}-[func]{}
|
||||
```
|
||||
|
||||
### 多次哈希
|
||||
|
||||
顾名思义,多次哈希方法是使用多个哈希函数 $f_1(x)$ , $f_2(x)$ , $f_3(x)$ , $\cdots$ 进行探测。
|
||||
|
||||
Reference in New Issue
Block a user