自已一直不懂HASH这方面的知识,最近回头重新学习数据结构,在一本国外教科书上看到了一个问题,没找到答案,各位V友能帮忙算下答案吗?thx!
Q:
Assume that you have a eleven-slot closed hash table (the slots are numbered 0 through 10). Show the final hash table that would result if you used the hash function h(k) = k mod 11 and quadratic probing on this list of numbers: 3, 12, 31,9, 53,2, 79, 25, 46.
1
zhyu 2015-06-24 14:34:59 +08:00
题目说了 "used the hash function h(k) = k mod 11 and quadratic probing"
所以 https://en.wikipedia.org/wiki/Quadratic_probing |
2
Flyshit OP 耐心看下书,搞定了
HASH表:46 12 2 3 25 -- 79 -- 53 31 9 探查次数: 6 1 1 1 2 -- 4 -- 3 1 2 AVL=21/9 不知道有没有错,但愿别误导到未来搜索到此贴的朋友 0.0 话说V2EX没有编辑功能么? |
3
Flyshit OP 打错,应该是ASL=21/9
|