From 1bdd96a345efd5a800c74fcb252fee342621ff83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=89=E6=96=87=E6=9D=B0?= <510495266@qq.com> Date: Sat, 16 Oct 2021 01:03:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E6=80=A7=E6=8E=A2=E6=B5=8B=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3 Hash Table/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/3 Hash Table/README.md b/3 Hash Table/README.md index aecec75..409a780 100644 --- a/3 Hash Table/README.md +++ b/3 Hash Table/README.md @@ -97,7 +97,9 @@ hash 表有一个特性, 随着元素越来越多, 新插入一个元素发 ### 线性探测法 -使用大小为M的数组保存N个键值对,当碰撞发生时,直接检查散列表中的下一个位置。 +使用大小为M的数组保存N个键值对,当碰撞发生时,直接检查散列表中的下一个位置,如果发现空位置插入新元素。 + +查找key时,先通过 hash(key) 得到 index, 看index 处 key 是否已经存在,不存在,就向后遍历数组。 ## 数据结构和算法