AVL Trees Exercises
- Discuss with your neighbor:
- What an AVL tree is (and is not)
- The main advantage(s) of using an AVL tree
- The Big-Ohs for AVL tree operations:
|
Average-case |
Worst-case |
Retrieval
|
|
|
Insertion
|
|
|
Deletion
|
|
|
Traversal
|
|
|
- Review the AVL rotations handout
- Insert the numbers 1, 2, ... 10 into an AVL tree.
Draw the tree after each insertion.
If appropriate, identify:
- the imbalanced node
- what type of rotation is needed
Double check that:
- after each rotation that it's a BST
- after each insertion that it's an AVL tree
- Insert the numbers 10, 9, ... 5 into an AVL tree.
Draw the tree after each insertion.
If appropriate, identify:
- the imbalanced node
- what type of rotation is needed
- Insert the numbers 1, 11, 2, 10, 3, 9, 4, 8, 5, 7, 6 into an AVL tree.
Draw the tree after each insertion.
If appropriate, identify:
- the imbalanced node
- what type of rotation is needed
Last Modified: