mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Add typing to data_structures/hashing/hash_table.py (#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>
This commit is contained in:
parent
d15bf7d492
commit
aeb933bff5
|
@ -7,13 +7,18 @@ class HashTable:
|
|||
Basic Hash Table example with open addressing and linear probing
|
||||
"""
|
||||
|
||||
def __init__(self, size_table, charge_factor=None, lim_charge=None):
|
||||
def __init__(
|
||||
self,
|
||||
size_table: int,
|
||||
charge_factor: int | None = None,
|
||||
lim_charge: float | None = None,
|
||||
) -> None:
|
||||
self.size_table = size_table
|
||||
self.values = [None] * self.size_table
|
||||
self.lim_charge = 0.75 if lim_charge is None else lim_charge
|
||||
self.charge_factor = 1 if charge_factor is None else charge_factor
|
||||
self.__aux_list = []
|
||||
self._keys = {}
|
||||
self.__aux_list: list = []
|
||||
self._keys: dict = {}
|
||||
|
||||
def keys(self):
|
||||
return self._keys
|
||||
|
|
Loading…
Reference in New Issue
Block a user