1 / 5
文档名称:

数据结构与算法分析课后题答案.pdf

格式:pdf   页数:5
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

数据结构与算法分析课后题答案.pdf

上传人:autohww 2016/6/19 文件大小:0 KB

下载得到文件列表

数据结构与算法分析课后题答案.pdf

相关文档

文档介绍

文档介绍:课后答案网,用心为你服务! 大学答案 ---中学答案---考研答案---考试答案最全最多的课后习题参考答案, 尽在课后答案网( )! Khdaw 团队一直秉承用心为大家服务的宗旨,以关注学生的学习生活为出发点, 旨在为广大学生朋友的自主学台。 爱校园( ) 课后答案网( ) 淘答案( ) Chapter 5: Hashing (a) On the assumption that we add collisions to the end of the list (which is the easier way if a hash table is being built by hand), the separate chaining hash table that results is shown here. 4371 1323 6173 4344 4199 9679 1989 0 1 2 3 4 5 6 7 8 9 (b) 9679 4371 1989 1323 6173 4344 4199 0 1 2 3 4 5 6 7 8 9 -25- 案网(c) 9679 4371 1323 6173 4344 1989 4199 0 1 2 3 4 5 6 7 8 9 (d) 1989 cannot be inserted into the table because hash O 2 (1989) =6, and the alternative locations 5, 1, 7, and 3 are already taken. The table at this point is as follows: 4371 1323 6173 9679 4344 4199 0 1 2 3 4 5 6 7 8 9 When rehashing, we choose a table size that is roughly twice as large and prime. In our case, the appropriate new table size is 19, with hash function h O ( x O ) = x O ( mod O 19). (a) Scanning down the separate chaining hash table, the new locations are 4371 in list 1, 1323 in list 12, 6173 in list 17, 4344 in list 12, 4199 in list 0, 9679 in list 8, and 1989 in list 13. (b) The new locations are 9679 in bucket 8, 4371 in bucket 1, 1989 in bucket 13, 1323 in bucket 12, 6173 in bucket 17, 4344 in bucket 14 because both 12 and 13 are already occu- pied, and 4199 in bucket 0. -26- 案网(c) The new locations a