双散列

双哈希(Double hashing),是通过两个哈希函数来查找位置。

例子:

假设

散列地址空表插入89插入18插入49插入58插入69
069
1
2
35858
4
5
6494949
7
818181818
98989898989

没有与第9格冲突,所以被安置到第9格


没有与第8格冲突,所以被安置到第8格


与第9格冲突,所以需要

没有与第6格冲突,所以被安置到第6格


与第8格冲突,所以需要

没有与第3格冲突,所以被安置到第3格


与第9格冲突,所以需要

没有与第0格冲突,所以被安置到第0格

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.