Lecture 20
Learning objectives
After this class, you should be able to:
- Write code implementing self-restructuring BSTs, using single rotations (move-up) and move-to-root.
- 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.
- Given an application, suggest a suitable self-restructuring technique for it (which may be different from those discussed in class).
Reading assignment
- Class notes.
- Lecture: Self-adjusting trees.
Exercises and review questions
- Exercises and review questions on current lecture's material
- Insert the following data into a self-restructuring BST:
8, 4, 10, 2, 6, 9
. Show the tree that results from searching for 6
using each of the following techniques: (i) single rotation, and (ii) move to the root.
- Questions on next lecture's material
- None.
Last modified: 19 Oct 2011