Lecture 21

Learning objectives

After this class, you should be able to:

  1. Write code to implement deletion from an AVL tree, and give its time complexity.
  2. Given a sequence of insertions into an AVL tree, and deletions from it, draw the tree.
  3. Write code implementing self-restructuring BSTs, using single rotations and move-to-root.
  4. Given a sequence of insert and search operations on a BST, draw the resulting tree when one of the self-restructuring techniques mentioned above is used.
  5. Given an application, suggest a suitable self-restructuring technique for it (which may be different from those discussed in class).
  6. Given a BST and probabilities of searching for nodes in it, derive the average search time.

Reading assignment

  1. Section 6.7.2 (deletion) and section 6.8, up to (and including) 6.8.1.
  2. Pages 271-272.

Exercises and review questions


Last modified: 27 Mar 2008