给出以下代码的mermaid算法流程:int hash_table_num(string key) { int d = 0; for(int i = 0; i<key.size(); i++) d = d + key[i]; return d % m; } //开放地址法 线性探测法 int hash_found(string key,HashTable * table) { int t = hash_table_num(key); while(table[t].KeyName != key) //有冲突 t = (t+1) % m; return t; }
时间: 2024-03-15 19:45:09 浏览: 110
typora-blog::mermaid_light_skin_tone:用Typora写博客!
```mermaid
graph TD;
A((开始)) --> B[计算哈希值d];
B --> C[返回d%m];
C --> D((结束));
E((开始)) --> F[计算哈希值t];
F --> G{table[t].KeyName!=key};
G -- Yes --> H[t=(t+1)%m];
G -- No --> I[返回t];
H --> F;
E --> I;
```
阅读全文