Ch3-4哈希表--2.pptVIP

  • 4
  • 0
  • 约3.7千字
  • 约 27页
  • 2016-12-31 发布于河南
  • 举报
Ch3-4哈希表--2

Ch3哈希表 高文宇 gwyy@163.com 哈希表 Hash table ST实现总结 除了平衡树,还有更好的方法吗? Hash表 Hash表:将记录存放在key-index表中。 Hash函数:如果有一个能保存M个键值对的数组,那么我们需要一个能够将任意键转化为该数组范围内的索引的函数(0~M-1),即Hash函数。 Hash表中需要解决的主要问题: ? Computing the hash function. ? Equality test: Method for checking whether two keys are equal. ? Collision resolution: Algorithm and data structure to handle two keys that hash to the same array index. Hash表是典型时-空权衡的例子: ? No space limitation: trivial hash function with key as index. ? No time limitation: trivial collision resolution with sequential search. ? Space and time limitations: hashing (the real world). Has

文档评论(0)

1亿VIP精品文档

相关文档