This project implements a simple hash map in C using separate chaining to handle collisions. It provides basic operations such as creating the map, inserting key-value pairs, removing entries, checking whether a key exists, displaying the contents, and freeing memory.
- Create a hash map
- Insert key-value pairs
- Remove entries by key
- Check whether a key already exists
- Display all stored entries
- Clean up allocated memory
hashMap.c- Contains the hash map implementationheader.h- Defines the node structure, hash map structure, and function prototypesmain.c- Demonstrates basic usage of the hash map
Compile the program with:
gcc main.c hashMap.c -o programRun it with:
./programOn Windows, you can also run the generated executable:
program.exeThe sample driver inserts a few key-value pairs, displays them, removes some entries, and then clears the memory.