AVLTree is an implementation of a self-balancing binary search tree (AVL) that provides efficient data storage and fast access. The implementation includes support for standard insert, delete, and search operations, as well as iterators and a unique distance method, which works faster than the equivalent functionality in std::set.
- 🔹 Fast insertion and deletion:
bool insert(const T& data),bool erase(const T& data) - 🔹 Element search:
const Node* find(const T& data) const& - 🔹 Tree clearing:
void clear() - 🔹 Tree swapping:
void swap(Tree::AVLTree<T, T_Height>& AvlTree) - 🔹 Get tree size:
unsigned short size() const - 🔹 Fast distance calculation between elements:
unsigned int distance(const T& element1, const T& element2) const(faster thanstd::set) - 🔹 Iterator support for easy traversal of tree elements
- Clone the repository:
git clone https://github.com/Onelig/AVLTree.git
cd AVLTree- Include the header file AVLTree.hpp in your project
#include "AVLTree.hpp" mkdir build && cd build
cmake ..
cmake --build .
ctest If you like this project, feel free to give it a star! ⭐ Always happy to hear your feedback and suggestions. If you have any questions or ideas for improvement — feel free to create issues or pull requests. The tree will keep growing and evolving! 🚀
AVLTree is licensed under the MIT License, see LICENSE for more information.
AVLTree — это реализация сбалансированного двоичного дерева поиска (AVL), обеспечивающего эффективное хранение и быстрый доступ к данным. Реализация включает поддержку стандартных операций вставки, удаления и поиска, а также итераторов и уникального метода distance, работающего быстрее, чем аналогичный функционал в std::set.
- 🔹 Быстрая вставка и удаление:
bool insert(const T& data),bool erase(const T& data) - 🔹 Поиск элемента:
const Node* find(const T& data) const& - 🔹 Очистка дерева:
void clear() - 🔹 Обмен деревьями:
void swap(Tree::AVLTree<T, T_Height>& AvlTree) - 🔹 Получение размера:
unsigned short size() const - 🔹 Быстрое вычисление расстояния между элементами:
unsigned int distance(const T& element1, const T& element2) const(быстрее, чемstd::set) - 🔹 Поддержка итераторов для удобной работы с элементами дерева
- Клонируй репозиторий:
git clone https://github.com/Onelig/AVLTree.git
cd AVLTree- Подключи заголовочный файл AVLTree.hpp в своём проекте:
#include "AVLTree.hpp" mkdir build && cd build
cmake ..
cmake --build .
ctest Если тебе понравился этот проект, ставь звезды! ⭐ Всегда рад фидбекам и предложениям. Если возникнут вопросы или идеи по улучшению - создавайте issues или pull request. Дерево будет расти и развиваеться! 🚀
Проект распространяется под лицензией MIT. Подробнее см. LICENSE.