HashMap的加载因子为什么默认为0.75
这应该是个经验数字,在Open Hashing中,加载因子选得太大了,访问的时候冲突太多,会降低效率;选得太小了,会浪费大量存储空间。Open Addressing的wikipedia中简略探讨了这个问题。As the load factor increases towards 100%, the number of probes that may be required to find or insert a given key rises dramatically. Once the table becomes full, probing algorithms may even fail to terminate. Even with good hash functions, load factors are normally limited to 80%.
谢谢楼主的分享!。。。 谢谢分享
页:
[1]