Split
split(x)
T
L
R
splay
OR
L
R
L
R
? x
? x
> x
< x
void split(Node * root, Node *& left,
Node *& right, Object x) {
Node * target = root->find(x);
splay(target);
if (target < x) {
left = target->left;
target->left = NULL;
right = target;
}
...
}
Previous slide
Next slide
Back to first slide
View graphic version