adjust indentation

This commit is contained in:
Jidong Xiao
2025-03-31 19:38:27 -04:00
committed by JamesFlare
parent 861382884c
commit 51d388be7c

View File

@@ -159,9 +159,10 @@ satisfy the second.
- Another example of a dangerous hash function on string keys is to add or multiply the ascii values of each char: - Another example of a dangerous hash function on string keys is to add or multiply the ascii values of each char:
```cpp ```cpp
unsigned int hash(string const& k, unsigned int N) { unsigned int hash(string const& k, unsigned int N) {
unsigned int value = 0; unsigned int value = 0;
for (unsigned int i=0; i<k.size(); ++i) for (unsigned int i=0; i<k.size(); ++i) {
value += k[i]; // conversion to int is automatic value += k[i]; // conversion to int is automatic
}
return value % N; return value % N;
} }
``` ```