Skip to content

W3b-crawl3r/hach-tabels-project-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hash Table Collision Analysis Project

This project implements and analyzes different hash functions for inserting keys into a hash table using separate chaining (linked lists) for collision resolution. The input keys are randomly generated alphanumeric strings stored in a file.

📁 Project Structure

  • main.cpp: Main source code containing all hash table logic.
  • cle.txt: Contains randomly generated alphanumeric keys.
  • hcode.dev, hcode.layout, Makefile.win, hcode.exe, main.o: IDE project and compiled output files (Dev-C++/Windows-specific).

⚙️ Features

  • Generate a file of random alphanumeric keys (cle.txt).
  • Implement three different hash functions to test collision performance.
  • Insert keys into a hash table using linked lists (chaining).
  • Display the number of elements in each hash table bucket.
  • Clean up memory by freeing the hash table.

🧮 Hash Functions

  1. Function 1: Multiplies character value by 19.
  2. Function 2: Squares character value and multiplies by 19.
  3. Function 3: Same as function 2, but also multiplies by the character's position.

🖥️ Menu Options

When running the program, the following menu is shown:

menu : 1: creer le fichier 2: init tab hash 3: creer tab hash 4: afficher nombre des elem 5: liberer 6: quitte

🔧 How to Compile

If you're using Dev-C++:

  1. Open the project via hcode.dev.
  2. Compile and run the project.

Or compile manually (e.g., using g++):

g++ -o hash_program main.cpp
./hash_program

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages