| 27 | return k % T_S; |
| 28 | } |
| 29 | void Insert(int k, int v) { |
| 30 | int h = HashFunc(k); |
| 31 | while (t[h] != NULL && t[h]->k != k) { |
| 32 | h = HashFunc(h + 1); |
| 33 | } |
| 34 | if (t[h] != NULL) |
| 35 | delete t[h]; |
| 36 | t[h] = new HashTableEntry(k, v); |
| 37 | } |
| 38 | int SearchKey(int k) { |
| 39 | int h = HashFunc(k); |
| 40 | while (t[h] != NULL && t[h]->k != k) { |