0% found this document useful (0 votes)
1K views21 pages

Left Child-Right Sibling Trees

This document discusses left child-right sibling representation of binary trees. It shows a tree being converted step-by-step from a non-binary tree to a full binary tree by placing each node's left child in its left link and sibling in its right link. The goal is to change the representation to a standard binary tree using this approach.

Uploaded by

sasipaper
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPS, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views21 pages

Left Child-Right Sibling Trees

This document discusses left child-right sibling representation of binary trees. It shows a tree being converted step-by-step from a non-binary tree to a full binary tree by placing each node's left child in its left link and sibling in its right link. The goal is to change the representation to a standard binary tree using this approach.

Uploaded by

sasipaper
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPS, PDF, TXT or read online on Scribd

Left Child-Right Sibling Representation

Instructor : Prof. Jyh-Shing Roger Jang


Designer Shao-Huan Wang
The ideas are reference to the textbook Fundamentals of Data Structures in C .

Left Child-Right Sibling Representation


A B E K L A B C D F C G D H I J M

Replaced by the left child-right sibling representation Put the left child node to the nodes left link Put the sibling to the nodes right link

Left Child-Right Sibling Representation


A B E K L A B E F C D F C G D H I J M

Replaced by the left child-right sibling representation Put the left child node to the nodes left link Put the sibling to the nodes right link

Left Child-Right Sibling Representation


A B E K L A B E F G C D F C G D H I J M

Replaced by the left child-right sibling representation Put the left child node to the nodes left link Put the sibling to the nodes right link

Left Child-Right Sibling Representation


A B E K L A B E F G C D H I J F C G D H I J M

Replaced by the left child-right sibling representation Put the left child node to the nodes left link Put the sibling to the nodes right link

Left Child-Right Sibling Representation


A B E K L A B E K L F G C D H I J F C G D H I J M

Replaced by the left child-right sibling representation Put the left child node to the nodes left link Put the sibling to the nodes right link

Left Child-Right Sibling Representation


A B E K L A B E K L F G M C D H I J F C G D H I J M

Replaced by the left child-right sibling representation Put the left child node to the nodes left link Put the sibling to the nodes right link

Left Child-Right Sibling Representation


A B E K L
B E K F

C F G
A

D H I M J

Replaced by the left child-right sibling representation Put the left child node to the nodes left link Put the sibling to the nodes right link Use a structure to link each node N::=link to NULL

N
C G H D

N
I J

N N
L

N N
M

N N N

N N

N N

Left Child-Right Sibling Representation

Change to binary tree A B E K L F G M C H D I J

Left Child-Right Sibling Representation

Change to binary tree A B G M C H D I J

E K L

Left Child-Right Sibling Representation

Change to binary tree A B C E K L F G M H I J D

Left Child-Right Sibling Representation

Change to binary tree A B E F K L G M C H I J D

Left Child-Right Sibling Representation

Change to binary tree A B E G F K L M C H I J D

Left Child-Right Sibling Representation

Change to binary tree A B E G K L F M C H I J D

Left Child-Right Sibling Representation

Change to binary tree A B E G K L F D M C H I J

Left Child-Right Sibling Representation

Change to binary tree A B E K L F G C H D M I J

Left Child-Right Sibling Representation

Change to binary tree A B E K L F G C H D M I J

Left Child-Right Sibling Representation

Change to binary tree A B E K L F G H C I D M J

Left Child-Right Sibling Representation

Change to binary tree A B E K L M F G H C I D J

Left Child-Right Sibling Representation

Change to binary tree A B E K L M F G H I C J D

Left Child-Right Sibling Representation

Change to binary tree A B E K L M F G H I J C D

You might also like