Skip to content

Commit afee19b

Browse files
committed
Update README.md
1 parent b6d7af2 commit afee19b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

AVL Tree/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# AVL tree
2+
3+
AVL tree is a self balancing form of Binary Tree in which height of subtrees differ at most by only 1.
4+
5+
6+
# Properties
7+
8+
A subtree dissatisfies AVL tree properties -- if `balance` factor is greater than `1` or lesser than `-1`
9+
where the balance factor is defined as following:
10+
11+
balance = height(left_subtree) − height(right_subtree)
12+
13+
(12/b:-2)
14+
\
15+
\
16+
(13/b:-1)
17+
\
18+
\
19+
(14/b:0)
20+
21+
# Searching and Inserting
22+
23+
Searching is done through a recursive function which searches the tree from top-down based on Binary Tree rules.
24+
25+
Inserting into the tree is similar to Binary Tree but differs by one additional opeartion which updates the `balance` variable.
26+
27+
28+
# See also
29+
[AVL tree on Wikipedia](https://en.wikipedia.org/wiki/AVL_tree)

0 commit comments

Comments
 (0)