赞
踩
5.1:
16 and 9 cannot be inserted into the table , because h2(16) is 5 , h2(9) is 5, the table size is 10 , the location 1 , 6 , 4 and 9 have already been inserted.
5.10:
Separate chaining hashing requires the use of links (which requires some memory) and the standard hash method Implement calls to memory allocation routines, which are usually expensive. Linear probing is easy to implement, but due to primary clustering, performance degrades significantly as load factors increase. Quadratic probing is slightly more difficult to implement and performs well in practice. If the table is half empty, the insert may fail, but this is unlikely. Even so, this insertion is true. This is not important, and will almost certainly point out a weakness in the hash function . Double hashing eliminates the primary and secondary clustering, but requires the calculation of a second hash function. And it could be expensive.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。