mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 04:31:55 +08:00
Several bug fixes.
This commit is contained in:
@ -47,7 +47,7 @@ class ArrayHashMap {
|
||||
int index = hashFunc(key);
|
||||
Pair *pair = buckets[index];
|
||||
if (pair == nullptr)
|
||||
return nullptr;
|
||||
return "";
|
||||
return pair->val;
|
||||
}
|
||||
|
||||
|
||||
@ -50,8 +50,8 @@ class HashMapChaining {
|
||||
return pair->val;
|
||||
}
|
||||
}
|
||||
// 若未找到 key 则返回 nullptr
|
||||
return nullptr;
|
||||
// 若未找到 key 则返回空字符串
|
||||
return "";
|
||||
}
|
||||
|
||||
/* 添加操作 */
|
||||
|
||||
Reference in New Issue
Block a user