what is an AVL tree
A binary search tree with the height balance property.
Adds an extra retracing step after altering the tree
what is the height of an AVL tree
O(log n)
where n is the number of nodes
what is retracing
travel up from an updated node and perform rotations if balance factor becomes left heavy (-2) or right heavy (2)
describe a left heavy tree and the action that should be taken
A is left of B
bf(B) = -2, bf(A) = 0 -> left right
bf (B) = -2, bf(A) = -1 -> right
describe a right heavy tree and the action that should be taken
A is right child of B
bf(B)=2, bf(A)=0 -> right left
bf(B)=2, bf(A)=1 -> left