For this assignment you are to implement a Table class using hash functions with open
addressing and linear probes for collision resolution. When you are done, use this class
to implement a solution to the word counting problem. The one relaxation is that the
words in the input do not need to be printed in alphabetical order.
a) You are to implement a class called Table and place it and all its
supporting code in a file called table.py. Your class must support the following
interface:
t = Table(100)
o creates table that is estimated to hold no more than 100 entries; without a parameter, the default limit is 500.
o you can use a fixed-size Python list or a NumPy array, whatever you find most convenient. Please note that for efficient lookup, your actual table size should be a prime number at least 1.5 times the limit value provided (you want your load factor to be less than 2/3).
o you should handle the situation where the limit value is exceeded; in our
testing we will try to do this
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
23 | 24 | 25 | 26 | 27 | 28 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 1 | 2 | 3 | 4 | 5 |
Get Free Quote!
325 Experts Online