查看“︁双散列”︁的源代码
←
双散列
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{Multiple issues| {{Cleanup rewrite|time=2021-01-15T15:29:48+00:00}} {{Cleanup-jargon|time=2021-01-15T15:29:48+00:00}} {{Notability Unreferenced|time=2021-01-15T15:29:48+00:00}} {{Unreferenced|time=2021-01-15T15:29:48+00:00}} }} '''雙雜湊'''(Double hashing),是透過兩個[[雜湊函式]]來查詢位置。 <math>h_i(k)=(hash_1(k)+i*hash_2(k))</math> 例子: 假設<math>hash_1=k mod 10</math>;<math>hash_2=7-(k mod 7)</math> {| class="wikitable" |- ! 散列地址 !! 空表 !! 插入89 !! 插入18 !! 插入49 !! 插入58 !! 插入69 |- | 0 || || || || || ||69 |- | 1 || || || || || || |- | 2 || || || || || || |- | 3 || || || || ||58 ||58 |- | 4 || || || || || || |- | 5 || || || || || || |- | 6 || || || ||49 ||49 ||49 |- | 7 || || || || || || |- | 8 || || ||18 ||18 ||18 ||18 |- | 9 || ||89 ||89 ||89 ||89 ||89 |} <math>h_0(89)=9</math>沒有與第9格衝突,所以被安置到第9格 <math>h_0(18)=8</math>沒有與第8格衝突,所以被安置到第8格 <math>h_0(49)=9</math>與第9格衝突,所以需要<math>h_1</math> <math>h_1(49)=(9+(7 - 49mod7)) mod 10=6</math>沒有與第6格衝突,所以被安置到第6格 <math>h_0(58)=8</math>與第8格衝突,所以需要<math>h_1</math> <math>h_1(58)=(8+(7 - 58mod7)) mod 10=3</math>沒有與第3格衝突,所以被安置到第3格 <math>h_0(69)=9</math>與第9格衝突,所以需要<math>h_1</math> <math>h_1(69)=(9+(7 - 69mod7)) mod 10=0</math>沒有與第0格衝突,所以被安置到第0格
该页面使用的模板:
Template:Multiple issues
(
查看源代码
)
返回
双散列
。
导航菜单
个人工具
登录
命名空间
页面
讨论
不转换
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
工具
链入页面
相关更改
页面信息