Welcome to KeyArray, a high-performance C++ data structure designed for fast key-based access. With guaranteed O(1) operations, dynamic resizing, and a memory-efficient design, KeyArray is perfect for applications that require quick access to data.
- Fast Access: Achieve O(1) access time for key-based lookups.
- Dynamic Resizing: Automatically resize the array to accommodate more data without performance loss.
- Memory Efficient: Optimized for low memory usage while maintaining speed.
- Open Source: Free to use and modify under the MIT License.
- Cross-Platform: Works on various operating systems.
To get started with KeyArray, you need to clone the repository and include the necessary files in your project.
git clone https://github.com/Zyhco/KeyArray.git
After cloning, navigate to the project directory and include the header file in your C++ project.
#include "KeyArray.h"
Using KeyArray is straightforward. Below is a simple example to demonstrate how to use this data structure.
#include "KeyArray.h"
#include <iostream>
int main() {
KeyArray<int, std::string> myArray;
myArray.insert(1, "Apple");
myArray.insert(2, "Banana");
std::cout << "Key 1: " << myArray.get(1) << std::endl;
std::cout << "Key 2: " << myArray.get(2) << std::endl;
return 0;
}
- insert(key, value): Adds a key-value pair to the array.
- get(key): Retrieves the value associated with the given key.
- remove(key): Deletes the key-value pair from the array.
We welcome contributions to improve KeyArray. If you have suggestions or bug fixes, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or fix.
- Commit your changes.
- Push your branch and create a pull request.
Please ensure that your code adheres to the existing style and includes appropriate tests.
KeyArray is licensed under the MIT License. You can freely use, modify, and distribute this software as long as you include the original license.
For the latest releases and updates, please visit our Releases section. Here, you can download the latest version and view the changelog.
For questions or suggestions, feel free to reach out:
- Email: [email protected]
- GitHub: Zyhco
Thank you for your interest in KeyArray! We hope it helps you in your projects.