HashMap什么时候由链表转红黑树
结论是目前能触发转化的两个条件是:一个是链表的长度达到8个,一个是数组的长度达到64个
为什么要触发这个转换,目前官方的解释:
Because TreeNodes are about twice the size of regular nodes, we use them only when bins contain enough nodes to warrant use (see TREEIFY_THRESHOLD). And when they become too small (due to re
转载
2020-08-11 18:36:52 ·
3450 阅读 ·
0 评论