计算机应用 ›› 2010, Vol. 30 ›› Issue (11): 2965-2966.

• 数据库与数据挖掘 • 上一篇    下一篇

有效的哈希冲突解决办法

张朝霞,刘耀军   

  1. 太原师范学院
  • 收稿日期:2010-04-27 修回日期:2010-07-01 发布日期:2010-11-05 出版日期:2010-11-01
  • 通讯作者: 张朝霞

Effective solution to Hash collision

,   

  • Received:2010-04-27 Revised:2010-07-01 Online:2010-11-05 Published:2010-11-01

摘要: 为了提高解决哈希冲突的效率,在冲突解决机制和数据元素被查找的先验概率的基础上,结合堆排序的优点,提出了一种更有效的处理哈希冲突的方法,称其为以先验概率为基础的哈希大顶堆查找。该方法首先依据关键字被查的先验概率的大小建立相应的哈希大顶堆,然后利用哈希大顶堆进行查找。最后通过严密的效率分析可看出:该方法在最坏的情况下的时间复杂度才为O(n log n),不但降低了冲突时执行查询的查找长度,从而降低查询响应的时间复杂度,而且该方法对于记录数越大的文件越适用。

关键词: 链地址法, 哈希冲突, 先验概率, 哈希查找, 哈希平衡树

Abstract: To improve the efficiency of Hash conflict-solving, a more effective method to deal with Hash collision was proposed based on a conflict-solving mechanism and the prior probability of the searched elements and combined with the advantages of heap sort. This method was defined as a prior probability-based Hash heap big top, which established a corresponding Hash heap big top based on the prior probability of the searched elements and then began the research with it. The time complexity of searching is O(n log n) at worst. Hence, this algorithm can not only reduce the searching length when conflicts occur so as to shorten the time complexity of searching, but also be applicable to huge sets of keys.

Key words: chain addressing, hash collision, prior probability, hash search, hash AVL tree