HashMap中的一些面试题
时间:2020-03-05 21:29:07
收藏:0
阅读:50
为什么要讲容量设置为2的N次放
1 h&(length-1)=h%length length必须为2的N次方
2 位运算符耗时:2640ms
取模运算:25157 (取模运算太耗费时间)
3 数组扩容,大量rehash(取模)
原文:https://www.cnblogs.com/shujiying/p/12422738.html
评论(0)