mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-24 02:21:30 +08:00
build
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user