Skip to content

Commit e8a93ac

Browse files
committed
📝 Writing docs.
1 parent fe0613a commit e8a93ac

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/collections/HashMap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ map.forEach((key,value)->{
6666
> 所以 HashMap 只能在单线程中使用,并且尽量的预设容量,尽可能的减少扩容。
6767
6868
`JDK1.8` 中对 `HashMap` 进行了优化:
69-
`hash` 碰撞之后写入链表的长度超过了阈值(默认为8),链表将会转换为**红黑树**
69+
`hash` 碰撞之后写入链表的长度超过了阈值(默认为8)并且 `table` 的长度不小于64(否则扩容一次)时,链表将会转换为**红黑树**
7070

7171
假设 `hash` 冲突非常严重,一个数组后面接了很长的链表,此时重新的时间复杂度就是 `O(n)`
7272

0 commit comments

Comments
 (0)