mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-24 09:07:14 +00:00
Fix the code of hash map chaining.
This commit is contained in:
@@ -89,10 +89,10 @@ func (m *hashMapChaining) remove(key int) {
|
||||
if p.key == key {
|
||||
// 切片删除
|
||||
m.buckets[idx] = append(m.buckets[idx][:i], m.buckets[idx][i+1:]...)
|
||||
m.size -= 1
|
||||
break
|
||||
}
|
||||
}
|
||||
m.size -= 1
|
||||
}
|
||||
|
||||
/* 扩容哈希表 */
|
||||
|
||||
Reference in New Issue
Block a user