Project #1
Watch the video. Write a program to demonstrate the "One Array"
hashing algorithm described in the video.
Requirements/Notes:
- to simplify the demo
- allow only positive integers
- keep the hash array small (20?, 50?, 100?, ...)
- create a interactive program that allows the user to
- enter positive integers (to be stored)
- test for integers in the hash table
- display meaningful statistics
(number of empty and filled buckets,
the number of collisions, etc.)
- exit the program
- Wrap around if you reach the end of the array
Project #2
Modify Project #1 to hold data objects (see the @dataclass decorator).
The objects should have several fields one of which is the the key.
For example fields could contain:
- first name
- middle name
- last name
- first + last name
- employee number
- occupation (category?)
- phone number
- pet type and name (if any)
- home address
- street name or PO box
- street name and number, or PO box
- city
- state
- zip code
- country
- ...
- hobbies
- ...
Design Notes:
- Don't go crazy on the number of fields. This is just for testing
the algorithm/code.
- Instead of the user inputting data, read a CSV file?
(The user still searches.)
- What to do if the hash array is full?
Links
HashMaps & Dictionaries, Explained Simply
(YouTube)