It's a so-so idea. Diving down the taller tree may take longer than diving down the shorter tree, which is a disadvantage. Deleting a leaf from the taller tree may move the two subtrees more into balance, which is an advantage, but only if there's one leaf furthest away, otherwise the height remains the same. Also, you colleague's scheme does nothing about insertions.
Yes it is. If the key being deleted is at the end of the node's key sequence — that is, either k0 or kn-1 where n is the number of keys in the node — and the outer most child is missing — that is, either c0 or cn — then the node can be deleted without dragging up a replacement key from the other child.
It depends on what you mean by “near by.” If “near by” means “children and parents” then AVL trees are better positioned than are splay trees to take advantage of spatial locality. Because they locally manipulate heights, AVL-tree rotations don't redistribute neighboring nodes too far away from the accessed node. In contrast, splay-tree rotations have potentially global effect, distributing neighboring nodes farther away from the accessed node that would an AVL tree. (Deletions from AVL trees may manipulate the tree globally too, but they are a sequence of local manipulations and not as severe in their effects as splay-tree rotations).
If “near by” means “near-by keys in order”, it seems more of a toss up. Looking at individual operations, AVL trees have the advantage by being in balance while a splay tree may be skewed past the O(log n) bound. Over a sequence of access however, which seems a more appropriate point of view relative to spatial locality, the access costs should even out.
This page last modified on 16 October 2008. |