1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-08-01 16:28:03 +08:00

Merge pull request #2393 from JosephConrad2017/main

Update java-collection-questions-02.md
This commit is contained in:
Guide 2024-05-17 08:33:08 +08:00 committed by GitHub
commit 7a31e22f8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -239,7 +239,7 @@ for (int binCount = 0; ; ++binCount) {
// 遍历到链表最后一个节点 // 遍历到链表最后一个节点
if ((e = p.next) == null) { if ((e = p.next) == null) {
p.next = newNode(hash, key, value, null); p.next = newNode(hash, key, value, null);
// 如果链表元素个数大于等于TREEIFY_THRESHOLD8 // 如果链表元素个数大于TREEIFY_THRESHOLD8
if (binCount >= TREEIFY_THRESHOLD - 1) // -1 for 1st if (binCount >= TREEIFY_THRESHOLD - 1) // -1 for 1st
// 红黑树转换(并不会直接转换成红黑树) // 红黑树转换(并不会直接转换成红黑树)
treeifyBin(tab, hash); treeifyBin(tab, hash);