Table of Contents
About The Project
This project is the AVL tree implementation functioning as a set. Inputs data from avlset.in
file. Outputs result in avlset.out
file.
The format of the input is as follows:
N
(number of operations) goes on the first line- Then
N
lines follow in the formatX x
WhereX
could be: A
- insert element into the set if it is not thereD
- delete the element from the set if it is thereC
- check the existence of an element in the set
x
is of type int
The format of the output is as follows:
- for each request
C x
, outputsY
(element is in the set) orN
(element is not in the set) - outputs the balance of the root for each operation
A x
andD x
Getting Started
To see the set in action on your machine, follow the simple steps below.
Installation
- Clone the repo
git clone https://github.com/MariaMozgunova/avl_tree.git
- Create
avtset.in
andavlset.out
files in the same directory - Run file
avl_tree.cpp
Example
Example of the input file:
6
A 3
A 4
A 5
C 4
C 6
D 5
Example of the corresponding output file:
0
1
0
Y
N
-1
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Maria Mozgunova - Twitter - @MariaMozgunova - mariiamozgunova@gmail.com
Project Link: https://github.com/MariaMozgunova/avl_tree