Skip to content

Update 01.Hash-Table.md #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 语言描述 - 裘宗燕 著