Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kopach-artem/hashtable

A comprehensive C++ library for efficient data management using hash tables. Features customizable hashing, collision resolution.
https://github.com/kopach-artem/hashtable

c-plus-plus cpp data-structures hash-map hash-table hashtable

Last synced: 27 days ago
JSON representation

A comprehensive C++ library for efficient data management using hash tables. Features customizable hashing, collision resolution.

Awesome Lists containing this project

README

        

# C++ Hash Table Implementation
Welcome to the repository for a custom C++ hash table implementation. This project is dedicated to providing a high-performance, templated hash table for efficient key-value storage and retrieval.

## Features
- Templated Implementation: Create hash tables for any data type.
- Collision Resolution: Implements separate chaining to handle hash collisions gracefully.
- Custom Hash Functions: Supports user-defined hash functions to tailor performance based on specific data distributions.
- Iterator Support: Navigate through your hash table with standard C++ iterators.
- Performance Optimized: Built with performance and low memory footprint in mind.
- Exception Handling: Comprehensive error and exception management for reliability and ease of debugging

## Getting Started
To use the hash table in your project, simply clone the repository and include the Hash_Table.h file in your source code.

**git clone https://github.com/koapch-artem/HashTable.git**

***Here's a quick example to get you started:***

```
#include "Hash_Table.h"

int main() {
HashTable myHashTable;
myHashTable.insert(1, "value1");
myHashTable.insert(2, "value2");

std::string value;
if (myHashTable.find(1, value)) {
std::cout << "Key 1 has value: " << value << std::endl;
}

return 0;
}
```

## Usage
***To create a hash table, simply define a HashTable object with the desired key and value types:***

```
HashTable table;
```
You can then use the following member functions:

- insert: To insert a new key-value pair.
- remove: To delete a key-value pair by its key.
- find: To retrieve the value associated with a given key.
- clear: To remove all key-value pairs from the hash table.
- size: To get the number of stored key-value pairs.

## Contributing
We welcome contributions to this project! If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

Don't forget to give the project a star! Thanks again!

- Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request

## License
Distributed under the MIT License. See LICENSE for more information.

## Acknowledgments

- **Viktor Prutyanov** @viktor-prutyanov: Viktor was my supervisor for the Hash Tables project. His guidance and expertise were instrumental in the development and success of this project.

## Contact
Your Name – @kopach-artem – [email protected]

Project Link: https://github.com/kopach-artem/HashTable