Update hash_map.md (#1802)

* Update hash_map.md

对目标句子的表达略微修改,使得前后句子的语义更加一致。

* Fix wording for bucket index calculation

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
sunshinesDL
2025-09-20 19:26:04 +08:00
committed by GitHub
parent 218e21e800
commit a69b5ef93b

View File

@ -559,7 +559,7 @@
输入一个 `key` ,哈希函数的计算过程分为以下两步。
1. 通过某种哈希算法 `hash()` 计算得到哈希值。
2. 将哈希值对桶数量(数组长度)`capacity` 取模,从而获取该 `key` 对应的数组索引 `index` 。
2. 将哈希值对桶数量(数组长度)`capacity` 取模,从而获取该 `key` 对应的桶(数组索引`index` 。
```shell
index = hash(key) % capacity