mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 02:13:15 +08:00
Fix rehashing function will not call insert_data function (#1803)
* Fix rehashing function will not call insert_data function * Fix typo * Update loop syntax instead of allocating a list Co-Authored-By: Christian Clauss <cclauss@me.com> Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
@ -62,7 +62,8 @@ class HashTable:
|
||||
self.size_table = next_prime(self.size_table, factor=2)
|
||||
self._keys.clear()
|
||||
self.values = [None] * self.size_table # hell's pointers D: don't DRY ;/
|
||||
map(self.insert_data, survivor_values)
|
||||
for value in survivor_values:
|
||||
self.insert_data(value)
|
||||
|
||||
def insert_data(self, data):
|
||||
key = self.hash_function(data)
|
||||
|
Reference in New Issue
Block a user