主题:问下关于哈希表?
ws0415
[专家分:3370] 发布于 2007-12-08 19:26:00
哈希表是数组和链表的结合
为什么它查找起来快呢?
键值和数据是怎么存储的?谢谢了
数组存储的是链表的头结点?键值呢?能不能举个例子[em2][em10][em10]
回复列表 (共2个回复)
沙发
justforfun626 [专家分:18460] 发布于 2007-12-08 23:37:00
[quote] 哈希表是数组和链表的结合[/quote]
Possible, but not always!!!
HashTable has many different collision-handling mechanisms, eg. rehash, black-red-tree, bucket/linklist, etc....
I don't think you know the basic key-value concept on HashTable/HashMap yet.
The best answer to your question is read a book. All books will tell you the basics.
Thanks!
板凳
ws0415 [专家分:3370] 发布于 2007-12-08 23:51:00
谢谢!
不清楚哈希表原来还有这么多深奥的东西.
那最基本的哈希表是什么样的.我记得以前上的数据结构课还考试考了。
还是先去翻翻那本书再来请教吧
[em2][em2]
我来回复