This commit is contained in:
krahets
2023-09-02 23:53:33 +08:00
parent 503ca797b8
commit ca7b5c0ac2
12 changed files with 117 additions and 50 deletions

View File

@@ -123,7 +123,7 @@ index = hash(key) % capacity
int hash = 0;
const int MODULUS = 1000000007;
for (unsigned char c : key) {
cout<<(int)c<<endl;
cout << (int)c << endl;
hash ^= (int)c;
}
return hash & MODULUS;
@@ -647,13 +647,13 @@ $$
=== "JS"
```javascript title="built_in_hash.js"
// JavaScript 未提供内置 hash code 函数
```
=== "TS"
```typescript title="built_in_hash.ts"
// TypeScript 未提供内置 hash code 函数
```
=== "C"

View File

@@ -168,7 +168,7 @@ comments: true
HashMapChaining() : size(0), capacity(4), loadThres(2.0 / 3), extendRatio(2) {
buckets.resize(capacity);
}
/* 析构方法 */
~HashMapChaining() {
for (auto &bucket : buckets) {