mirror of
https://github.com/krahets/hello-algo.git
synced 2026-05-11 11:07:14 +08:00
Several bug fixes.
This commit is contained in:
@@ -18,7 +18,7 @@ class HashMapChaining {
|
||||
init() {
|
||||
size = 0
|
||||
capacity = 4
|
||||
loadThres = 2 / 3
|
||||
loadThres = 2.0 / 3.0
|
||||
extendRatio = 2
|
||||
buckets = Array(repeating: [], count: capacity)
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class HashMapOpenAddressing {
|
||||
init() {
|
||||
size = 0
|
||||
capacity = 4
|
||||
loadThres = 2 / 3
|
||||
loadThres = 2.0 / 3.0
|
||||
extendRatio = 2
|
||||
buckets = Array(repeating: nil, count: capacity)
|
||||
removed = Pair(key: -1, val: "-1")
|
||||
|
||||
Reference in New Issue
Block a user