Lecture 20
Learning objectives
After this class, you should be able to:
- Define an AVL search tree..
- Derive bounds on the height of an AVL tree.
- Write code to implement insertion into an AVL tree, and give its time complexity.
- Given a sequence of insertions into an AVL tree, draw the tree.
- Identify applications where a binary search tree will be useful.
Reading assignment
- Section 6.7 introduction, and 6.7.2 (except deletion).
- None.
Exercises and review questions
- Exercises and review questions on current lecture's material
- Insert the following elements into an AVL search tree in the order given below and draw the resulting tree:
10, 8, 4, 2, 0, 3, 7, 6, 5
.- Derive an upper bound on the height of an extended AVL tree, where the
|difference in heights of a left subtree and a right subtree| < 2
, using a procedure similar to that discussed in class.- Write code to implement a single rotation on an AVL tree, when a node gets balance factor -2 due to an insertion into its left child's left subtree.
- Questions on next lecture's material
- None.
Last modified: 20 Mar 2008