1231 and 1237 are just two (sufficiently large) arbitrary prime numbers. Any other two large prime numbers would do fine. When computing hash codes for composite objects it's common to add the hash codes for the components. If too small values are used in a hash set with a large number of buckets there's a risk of ending up with an uneven distribution of objects.
点赞 4

相关推荐

02-05 08:49
已编辑
武汉大学 Web前端
野猪不是猪🐗:36k和36k之间亦有差距,ms的36k和pdd的36k不是一个概念
点赞 评论 收藏
分享
02-12 17:30
已编辑
字节跳动_实习生(实习员工)
要怎么办呢牛:我觉得大厂日常实习最大的意义就是给自己背书,一个好公司的实习就像一个好学历似的,能够给自己增加一个标签,让别人觉得你可以。(至于真正实习干了啥,这个感觉并不太重要)。当然一家之言,仅供参考。另外,楼主已经很强了,实习毕业双双拿下,已经领先好多好多人了,羡慕啊
点赞 评论 收藏
分享
牛客网
牛客企业服务