Deleting from a 234-Tree
• To destroy a 2-node
– First, attempt to steal from a
sibling to make a 3-node
(must pass item through
parent to ensure order
remains valid)
– If that doesn’t work then
sibling is also a 2-node;
combine with sibling to steal
an item from the parent to
make a 4-node
– Note: parent is never a 2-
node, so can always steal
from parent if necessary
• Deleting is more complicated
than inserting
– For delete, we hate 2-nodes
– As in BSTs, cannot delete
from a nonleaf
– Use same BST trick: delete
successor/predecessor and
recopy its data
CS409 - Spring 2000
9