Difference: CSC122F2022Lab5Hash (2 vs. 3)

Revision 32022-09-29 - cathybareiss

Line: 1 to 1
 
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.
Line: 10 to 10
 
  1. Learn to work with random access files
  2. 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

Added:
>
>
Link for github classroom: https://classroom.github.com/a/m4-RJf6S

 Phase 1:
  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.
  2. Choose a collision handling function to work with your hashing function.
Changed:
<
<
  1. 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.
>
>
  1. 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.
 
  1. Design DataFile.java. This class should only have static methods, constants, and one class variable.
    1. 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.
    2. Constants
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback