Compute the hash index for a key. Args: key: The key to hash. Returns: Index into the internal array.
(self, key: int)
| 108 | return None |
| 109 | |
| 110 | def hash(self, key: int) -> int: |
| 111 | """Compute the hash index for a key. |
| 112 | |
| 113 | Args: |
| 114 | key: The key to hash. |
| 115 | |
| 116 | Returns: |
| 117 | Index into the internal array. |
| 118 | """ |
| 119 | return key % self.size |
| 120 | |
| 121 | def _rehash(self, old_hash: int) -> int: |
| 122 | """Linear probing rehash. |