Skip to content

Instantly share code, notes, and snippets.

View Edald123's full-sized avatar

Eduardo Ahumada Edald123

  • Mexico
View GitHub Profile
@Edald123
Edald123 / blossom_lib.py
Created August 3, 2021 04:53
List for test case for separate chaining
flower_definitions = [
['begonia', 'cautiousness'],
['chrysanthemum', 'cheerfulness'],
['carnation', 'memories'],
['daisy', 'innocence'],
['hyacinth', 'playfulness'],
['lavender', 'devotion'],
['magnolia', 'dignity'],
['morning glory', 'unrequited love'],
['periwinkle', 'new friendship'],
@Edald123
Edald123 / hash_table_blossom.py
Created August 3, 2021 04:55
Hash map using separate chaining to avoid collisions in Python
from linked_list_for_hash import Node, LinkedList
from blossom_lib import flower_definitions
class HashMap:
def __init__(self, size):
self.array_size = size
self.array = [LinkedList() for i in range(size)]
def hash(self, key):