From 951599e192259938a6a5d2e364599c5ca12487f9 Mon Sep 17 00:00:00 2001 From: Suremotoo Date: Thu, 18 May 2023 19:02:32 +0800 Subject: [PATCH] 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[] tab, int hash) { int n, index; Node e; if (tab == null || (n = tab.length) < MIN_TREEIFY_CAPACITY) } ``` * Update hash_collision.md --------- Co-authored-by: Yudong Jin --- docs/chapter_hashing/hash_collision.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/chapter_hashing/hash_collision.md b/docs/chapter_hashing/hash_collision.md index c2e49b46..e52ac9bf 100644 --- a/docs/chapter_hashing/hash_collision.md +++ b/docs/chapter_hashing/hash_collision.md @@ -72,7 +72,7 @@ !!! note "哈希表设计方案" - Java 采用「链式地址」。自 JDK 1.8 以来,当 HashMap 内数组长度大于 64 且链表长度大于 8 时,链表会被转换为「红黑树」以提升查找性能。 + Java 采用「链式地址」。自 JDK 1.8 以来,当 HashMap 内数组长度达到 64 且链表长度达到 8 时,链表会被转换为红黑树以提升查找性能。 Python 采用「开放寻址」。字典 dict 使用伪随机数进行探测。