AVL Trees
•	Definition
•	Empty BST is an AVL tree
•	Non-empty BST is an AVL tree if
.	Left and right subtrees are AVL trees
.	Height of the left and right subtrees don’t differ by more than 1
•	Balance factor
•	If height of left subtree is same as the height of right subtree, balance factor is 0
•	If height of left subtree is 1 more than the height of right subtree, balance factor is 1
•	If height of left subtree is 2 more than the height of right subtree, balance factor is 2
•	If height of left subtree is 1 less than the height of right subtree, balance factor is -1
•	If height of left subtree is 2 less than the height of right subtree, balance factor is -2
•	Whenever balance factor of a subtree becomes +/- 2, we use rotation to fix that subtree.
•	We have to identify what type of rotation we need
.	LL type: Left subtree was longer, the new item went to the left of left subtree. See board for example.
•	Single clockwise rotation
.	LR type: Left subtree was longer, the new item went to the right of left subtree. See board for example.
•	Double rotation: Counter clock wise on the left subtree and clockwise on the tree
.	RR type: Right subtree was longer, the new item went to the right of right subtree. See board for example.
•	Single counter clockwise rotation
.	RL type: Right subtree was longer, the new item went to the left of right subtree. See board for example.
•	Double rotation: clock wise on the right subtree and counter clockwise on the tree
•	Example in class:
•	84,77,70,63,65,91,98,105,100
•	Try on: 100,105,98,91,65,63,70,77,84