forked from mikeplatoon/data-structures
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhash.py
More file actions
24 lines (20 loc) · 961 Bytes
/
hash.py
File metadata and controls
24 lines (20 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class HashTable:
def __init__(self, number_of_buckets):
# self.number_of_buckets = number_of_buckets
# self.table = [None] * self.number_of_buckets
pass
def hash(self, value):
# here is where you'll turn your 'value' into a hash value that will return the index of your table to insert value
# IMPORTANT: Think about how you'd store values into the same index
pass
def set(self, value):
# here is where you'll perform your logic to insert the value into your table
# you'll also call your hash method here to get the index where you'll store the value
pass
def get(self, value):
# here is where you'll retreive your value from the hash table
# IMPORTANT: Think about how you'd retreive a value that from an index that has multiple values
pass
def has_key(self, value):
# here is where you'll return a True or False value if there is a value stored at a specific index in your HashTable
pass