mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-01 20:12:07 +08:00
Several bug fixes.
This commit is contained in:
@ -17,7 +17,7 @@ class HashMapChaining:
|
||||
"""构造方法"""
|
||||
self.size = 0 # 键值对数量
|
||||
self.capacity = 4 # 哈希表容量
|
||||
self.load_thres = 2 / 3 # 触发扩容的负载因子阈值
|
||||
self.load_thres = 2.0 / 3.0 # 触发扩容的负载因子阈值
|
||||
self.extend_ratio = 2 # 扩容倍数
|
||||
self.buckets = [[] for _ in range(self.capacity)] # 桶数组
|
||||
|
||||
|
||||
Reference in New Issue
Block a user