Implementation of the Hash Table Data Structure
This is an implementation of the Hash Table Data Structure in C++ that I made as part of an assignment in my Data Structures Course at the University. Hash Table is a special Data Structure that uses any object as a key into an array of other objects (key, value pair). The key is generated by hashing the objects and generating some integer value. Different hashing techniques are used. This uses very simple bitwise operations to manipulate the values, and caters for certain types such as uint64, string/const char*, char etc. If a key hashes to same index, it uses linked list to store them at that index. Also it increases size of Table by finding next largest prime, since that can prevent issues caused by even/odd bias, or using comp address which fills up half the table etc.
To get a local copy up and running follow these simple steps.
- C++ - Google for your OS.
- git
- Clone the repo
git clone https://github.com/saeenyoda/Hash_Table.git
- Open up command line or terminal and navigate to the cloned repo's directory
cd "PATH-TO-DIRECTORY"
- Run the main.cpp file (Using terminal on mac)
clang++ -std=c++14 -stdlib=libc++ -I "PATH-TO-includes-FOLDER" "PATH-TO-main.cpp" "PATH-TO-file.cpp" -o out/release/main
NOTE:
The instructions given above are for mac and that too using the terminal. For other OS and IDEs refer to the relevant docs.
Distributed under the MIT License. See LICENSE
for more information.