Skip to content

A simple hash table implementation in C, demonstrating fundamental concepts including hashing, collision resolution via chaining, and dynamic resizing for optimal performance.

License

Notifications You must be signed in to change notification settings

malewicz1337/hash-table-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Hash Table Implementation in C )))

This repository contains a simple implementation of a hash table in C. It demonstrates fundamental concepts of hash table design including hashing functions, collision resolution, and dynamic resizing.

Features

  • Custom Hash Table: Implementation of a hash table data structure.
  • Collision Resolution: Handles collisions using chaining.
  • Dynamic Resizing: Automatically resizes the hash table for optimal performance.
  • Prime Number Calculation: Utilizes prime numbers for hash functions.

Files

  • hash_table.c: Core implementation of the hash table.
  • hash_table.h: Header file for hash table functions.
  • main.c: Contains tests and examples of using the hash table.
  • prime.c: Functions for prime number calculations.
  • prime.h: Header file for prime number functions.

Usage

To use this hash table implementation:

Compile:

cd src
cc main.c hash_table.c prime.c -o ../build/main

Run:

cd ..
cd build
./main

Testing

The main.c file contains tests for various operations such as insertion, search, and deletion in the hash table. Compile and run this file to see the hash table in action.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A simple hash table implementation in C, demonstrating fundamental concepts including hashing, collision resolution via chaining, and dynamic resizing for optimal performance.

Topics

Resources

License

Stars

Watchers

Forks

Languages