CSC 322 Lab 3

07 Mar 2025 - 20:23 | Version 1 |

Objectives

  1. Improve Linux skills
  2. Code at least two hash routines and two collision handling algorithms for hashing
  3. Study the time implications of the the options for hashing

Problem

Write C code to:
  • Pick a state for the data set. That state must include at least 1,000 different schools. Randomize the order of the rows.
  • Store the school names in a hash table (that is at most 66% larger than the number of schools) using the zipcodes (5 digits and then 9 digits) as the key
  • Implement two different hashing functions and analyze the number of collisions when adding for each
  • Implement two different collision handling methods and analyze the search time when looking up each school.
  • Study the implications of different tables sizes in your analysis

Note: For this lab, you are required to do all work (except the writeup) on your virtual Linux machine.

Details

  1. The program is to allow for run in "batch" mode. The size of the data and the name of the input data and search data (two separate files) are command line arguments.
    • Example: % hashstudy 1525 addData.txt searchData.txt
  2. The program should produce output that specifies the following for all options: (at least 2 different hashing, at least 2 different collision handling, and at least 3 different tables sizes for each → so at least 12 different rows)
    • Hash function name
    • Number of collisions when storing the data
    • Collision handing name
    • Average number of compares when searching
    • Size of data, size of array, % full
  3. Come up with a plan for steps for coding and include those steps in your report (under design) and a statement about how well you followed it
  4. Guesstimate how long this lab will take and record it.
  5. Create a software development report include the two previous items and :
    1. include a discussion on the fragility of your program in the security report
    2. Lessons learned will be important. This also needs a discussion of the work. It should deal with discussions about collisions, array size, and average search time.
  6. Create a tar ball with all .c, .h, makefile, and SDR and submit it via Canvas (no .o)

Challenges

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This website is using cookies. More info. That's Fine