知识卡片
链地址把冲突留在同槽链表
链地址法让每个表槽指向同一哈希值元素的链表。
插入到表头可为 O(1),搜索要遍历相应链;已持有元素指针且使用双向链表时,删除也可 O(1)。
若只给删除键,仍须先查找,不能把删除成本直接记成常数。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第11章 散列表 · 查看原书依据
each nonempty slot points to a linked list, and all the elements that hash to the same slot go into that slot’s linked list.
参考来源
- 位置:《算法导论(第4版)》第 11 章 11.2 节(`OEBPS/chapter011.xhtml`,文本字符 [10000, 13000);图 11.3/Art_P380)。
- 结论依据:原文给出链表冲突结构、三种操作及删除接口输入对象而非键的条件。
- 原始内容:each nonempty slot points to a linked list, and all the elements that hash to the same slot go into that slot’s linked list.