Update hash_collision.md (#504)

* Update hash_collision.md

a detailed description of the conditions for converting a linked list into a red-black tree is as follows.
 
```java
  final void treeifyBin(Node<K,V>[] tab, int hash) {
        int n, index; Node<K,V> e;
        if (tab == null || (n = tab.length) < MIN_TREEIFY_CAPACITY)
}
```

* Update hash_collision.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
Suremotoo 2023-05-18 19:02:32 +08:00 committed by GitHub
parent 00f8253353
commit 951599e192
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,7 +72,7 @@
!!! note "哈希表设计方案"
Java 采用「链式地址」。自 JDK 1.8 以来,当 HashMap 内数组长度大于 64 且链表长度大于 8 时,链表会被转换为「红黑树」以提升查找性能。
Java 采用「链式地址」。自 JDK 1.8 以来,当 HashMap 内数组长度达到 64 且链表长度达到 8 时,链表会被转换为红黑树以提升查找性能。
Python 采用「开放寻址」。字典 dict 使用伪随机数进行探测。