Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
7 7
4 8 4 8
3 6 6
3
7
6
4 8
4 7
3 6
3 8
Splay 6 to root
5 is less than 6, so delete marked edge
6
4 7
3 8
B G
D H
C
E
F
ZIG operation
y x
y
x
C A
A B B C
ZIG-ZIG
z x
y
D A
x
z
C B
A B C D
ZIG-ZAG
z x
y y z
x D
A A B C D
B C
Operations in words
• zig: rotate edge joining x to p(x)
• zig-zig: rotate edge from p(x) to p(p(x));
then rotate edge from x to p(x)
• zig-zag: rotate edge from x to p(x); rotate
edge from x to new p(x).
Rotation of an edge
y
x
y
x
C
A
A B
B C
DEMO
• Demo