c->second_child = n;
rot = 270;
}
- n->birth_rotation = rot;
if (!n->vacant) {
+ n->birth_rotation = rot;
rotate_tree(p, rot);
}
}
node_t *b = brother_tree(n);
node_t *g = p->parent;
- if (!n->vacant) {
+ if (!n->vacant && cancel_birth_rotation) {
unrotate_tree(b, n->birth_rotation);
}
n->vacant = value;
if (value) {
- unrotate_brother(n);
cancel_presel(m, d, n);
- } else {
- rotate_brother(n);
}
}