Table of Contents
Many people use search engines to classify various information, as well as quickly obtain the necessary data. Our task is to study this issue in practice, which implies the development of search trees with a detailed study of all the subtleties of each model.
Types of search trees that we are going to implement:
- A simple Binary Search Tree.
- Red-Black Search Tree.
- AVL Search Tree.
Of course, our task is not only to develop the algorithm of the application itself, but also to implement the user interface to work with it, create test coverage and decent documentation.
Technologies used to develop the project:
To start working with our development, you need to clone repository:
-
git
git clone https://github.com/spbu-coding-2022/trees-12.git
To initialize the library and start working with it, you need to know the following lines:
-
Initializing BinarySearchTree (default RedBlackTree):
val tree = binarySearchTreeOf<KeyType, ValueType>()
-
Initializing simple BinarySearchTree:
val tree = SimpleBinarySearchTree<KeyType, ValueType>()
-
Initializing RedBlackTree:
val tree = RedBlackTree<KeyType, ValueType>()
-
Initializing AVLTree:
val tree = AVLTree<KeyType, ValueType>()
To work with trees, you also need to know the management commands:
-
Inserting a value by key:
tree[key] = value
-
Getting a value by key:
val value = tree[key]
-
Deleting a value by key:
tree.remove(key)
Before launching the application, you need to run "neo4j" via "docker":
- This is done by the command in project repository:
docker compose up -d
You also need to build the application and run it:
- This is done by the command:
./gradlew run
A little bit about the user interface:
- After launching the application, a window will appear in which you can select the desired type of tree, as well as previously saved models of this type.
- After you select the tree, a window will appear with functional buttons for adding, deleting and searching for values by key. Also, above the buttons you can see the type of the selected tree, and below them there will be buttons for saving and deleting the current model.
Distributed under the MIT License. See LICENSE
for more information.
Baitenov Arsene • Telegram • [email protected]
Gryaznov Artem • Telegram • [email protected]
Project Link • https://github.com/spbu-coding-2022/trees-12
The resources that we used to get information about binary search trees, their features and implementation possibilities: