Java Reference
In-Depth Information
Left Val ParRight
1
R
R'
3
A
0
2
6
B
0
R
X
C
1
4
D
1
5
A
B
E
1
F
2
C
D
E
F
8
R'
X
7
Figure6.10
The “left-child/right-sibling” implementation.
Left Val Par Right
1
R
7
8
R'
3
A
0
2
6
B
0
R
X
C
1
4
D
1
5
A
B
E
1
F
2
C
D
E
F
0
R'
X
7
Figure6.11
Combining two trees that use the “left-child/right-sibling” imple-
mentation. The subtree rooted at R in Figure 6.10 now becomes the first child
of R
0
. Three pointers are adjusted in the node array: The left-child field of R
0
now
points to node R, while the right-sibling field for R points to node X. The parent
field of node R points to node R
0
.