This is a simple implementation of a hash table data structure in the C programming language. A hash table is a data structure that allows you to store key-value pairs and quickly retrieve values based on their keys.
- Clone the Repository: First, clone this Git repository to your local machine:
git clone https://github.com/alvarorichard/HashTab.git
Navigate to the Project Directory: Change your working directory to the project folder:
cd HashC/build
Compile the Code: You can compile the code using xmake, which is a build tool that supports both GCC and Clang. Make sure you have xmake installed on your system. Use the following command to build the code:
xmake
This command will compile the main.c and hash_table.c files and create an executable named main. The -lm flag is included in the xmake.lua configuration file to link the math library.
Run the Executable: After compiling successfully, you can run the program:
This code provides a basic usage example of a hash table. You can use the provided functions in hash_table.c to create, insert, search, and delete key-value pairs in the hash table. Modify the main function in main.c to test your own key-value pairs and operations.
Feel free to customize the code to suit your specific needs or use it as a reference for working with hash tables in C.