11.07.2015 Views

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

208 Chap. 6 Non-Binary TreesR’RA BC D E FXLeft Val ParRight1 R3 A 0 26 B 0C 1 4D 1 5E 1F 28 R’X 7Figure 6.10 The “left-child/right-sibling” implement<strong>at</strong>ion.Left Val ParRight1 R 7 8R’3 A 0 26 B0RXC 1 4D 1 5ABE1F2CD E F0R’X7Figure 6.11 Combining two trees th<strong>at</strong> use the “left-child/right-sibling” implement<strong>at</strong>ion.The subtree rooted <strong>at</strong> R in Figure 6.10 now becomes the first childof R ′ . Three pointers are adjusted in the node array: The left-child field of R ′ nowpoints to node R, while the right-sibling field for R points to node X. The parentfield of node R points to node R ′ .

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!