This commit is contained in:
krahets
2023-05-22 22:01:18 +08:00
parent 29807a3761
commit be77ba7a70
16 changed files with 60 additions and 58 deletions

View File

@@ -631,7 +631,7 @@ $$
def hash_func(self, key: int) -> int:
"""哈希函数"""
index: int = key % 100
index = key % 100
return index
def get(self, key: int) -> str:
@@ -664,7 +664,7 @@ $$
def key_set(self) -> list[int]:
"""获取所有键"""
result: list[int] = []
result = []
for pair in self.buckets:
if pair is not None:
result.append(pair.key)
@@ -672,7 +672,7 @@ $$
def value_set(self) -> list[str]:
"""获取所有值"""
result: list[str] = []
result = []
for pair in self.buckets:
if pair is not None:
result.append(pair.val)