Skip to content

Commit aeb933b

Browse files
Add typing to data_structures/hashing/hash_table.py (TheAlgorithms#7040)
* Update hash_table.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update hash_table.py * Update hash_table.py Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent d15bf7d commit aeb933b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

data_structures/hashing/hash_table.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ class HashTable:
77
Basic Hash Table example with open addressing and linear probing
88
"""
99

10-
def __init__(self, size_table, charge_factor=None, lim_charge=None):
10+
def __init__(
11+
self,
12+
size_table: int,
13+
charge_factor: int | None = None,
14+
lim_charge: float | None = None,
15+
) -> None:
1116
self.size_table = size_table
1217
self.values = [None] * self.size_table
1318
self.lim_charge = 0.75 if lim_charge is None else lim_charge
1419
self.charge_factor = 1 if charge_factor is None else charge_factor
15-
self.__aux_list = []
16-
self._keys = {}
20+
self.__aux_list: list = []
21+
self._keys: dict = {}
1722

1823
def keys(self):
1924
return self._keys

0 commit comments

Comments
 (0)