| |
| META TOPICPARENT |
name="CSC122SylF2022" |
Hashing
In this lab we will be continue to study ways to process a large amount of data. We have two constraints we must meet. |
| |
- Learn to work with random access files
- Adapt a hashing routine to try to achieve O(1.3) with at most 35% wasted space when working with a very large set of data
Assignment |
|
> > | Link for github classroom: https://classroom.github.com/a/m4-RJf6S
|
| | Phase 1:
- Design a hashing function that creates two numbers. The first number will be used to specify the file. The second number will be used to indicate which record in that file.
- Choose a collision handling function to work with your hashing function.
|
|
< < |
- You will have access to SellItem.java. Make sure you understand every component. Design two classes (one static), both called hash that will receive an id (or use the id of the item) and hash it. They should return an array with the first item indicated which file and the second item indicated the record in that file.
|
> > |
- You will have access to SellItem.java. Make sure you understand every component. Design two methods (one static), both called hash that will receive an id (or use the id of the item) and hash it. They should return an array with the first item indicated which file and the second item indicated the record in that file.
|
| |
- Design DataFile.java. This class should only have static methods, constants, and one class variable.
- Class variable: The class variable should count the number of reads/writes. It needs to be able to be reset and the value reported back.
- Constants
|