[go: nahoru, domu]

Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
itcharge committed Jun 19, 2024
2 parents 1098dee + 74dc0f5 commit 5fdb5cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Contents/05.Hash-Table/01.Hash-Table.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
在上图例子中,我们使用 $value = Hash(key) = key // 1000$ 作为哈希函数。$//$ 符号代表整除。我们以这个例子来说明一下哈希表的插入和查找策略。

- **向哈希表中插入一个关键码值**:通过哈希函数解析关键字,并将对应值存放到该区块中。
- 比如:$0138$ 通过哈希函数 $Hash(key) = 0138 // 100 = 0$,得出应将 $0138$ 分配到 $0$ 所在的区块中。
- 比如:$0138$ 通过哈希函数 $Hash(key) = 0138 // 1000 = 0$,得出应将 $0138$ 分配到 $0$ 所在的区块中。
- **在哈希表中搜索一个关键码值**:通过哈希函数解析关键字,并在特定的区块搜索该关键字对应的值。
- 比如:查找 $2321$,通过哈希函数,得出 $2321$ 应该在 $2$ 所对应的区块中。然后我们从 $2$ 对应的区块中继续搜索,并在 $2$ 对应的区块中成功找到了 $2321$。
- 比如:查找 $3214$,通过哈希函数,得出 $3214$ 应该在 $3$ 所对应的区块中。然后我们从 $3$ 对应的区块中继续搜索,但并没有找到对应值,则说明 $3214$ 不在哈希表中。
Expand Down Expand Up @@ -164,4 +164,4 @@ $343246_{13} = 3 \times 13^5 + 4 \times 13^4 + 3 \times 13^3 + 2 \times 13^2 + 4
- 【博文】[散列表(上)- 数据结构与算法之美 - 极客时间](https://time.geekbang.org/column/article/64233)
- 【书籍】数据结构(C 语言版)- 严蔚敏 著
- 【书籍】数据结构教程(第 3 版)- 唐发根 著
- 【书籍】数据结构与算法 Python 语言描述 - 裘宗燕 著
- 【书籍】数据结构与算法 Python 语言描述 - 裘宗燕 著

0 comments on commit 5fdb5cf

Please sign in to comment.