left child-right sibling representation

Post on 10-Jan-2016

55 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

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. Replaced by the left child-right sibling representation. M. - PowerPoint PPT Presentation

TRANSCRIPT

Left Child-Right Sibling Representation

Instructor : Prof. Jyh-Shing Roger Jang

Designer : Shao-Huan WangThe ideas are reference to the textbook “Fundamentals of Data Structures in C “ .

Left Child-Right Sibling Representation

A

B C D

E F G H I J

K L M

Replaced by the left child-right sibling representation

A

Put the left child node to the node’sleft link

B

Put the sibling to the node’s right link

C D

Left Child-Right Sibling Representation

A

B C D

E F G H I J

K L M

Replaced by the left child-right sibling representation

A

Put the left child node to the node’sleft link

B

Put the sibling to the node’s right link

C D

E F

Left Child-Right Sibling Representation

A

B C D

E F G H I J

K L M

Replaced by the left child-right sibling representation

A

Put the left child node to the node’sleft link

B

Put the sibling to the node’s right link

C D

E F G

Left Child-Right Sibling Representation

A

B C D

E F G H I J

K L M

Replaced by the left child-right sibling representation

A

Put the left child node to the node’sleft link

B

Put the sibling to the node’s right link

C D

E F G H I J

Left Child-Right Sibling Representation

A

B C D

E F G H I J

K L M

Replaced by the left child-right sibling representation

A

Put the left child node to the node’sleft link

B

Put the sibling to the node’s right link

C D

E F G H I J

K L

Left Child-Right Sibling Representation

A

B C D

E F G H I J

K L M

Replaced by the left child-right sibling representation

A

Put the left child node to the node’sleft link

B

Put the sibling to the node’s right link

C D

E F G H I J

K L M

Left Child-Right Sibling Representation

Replaced by the left child-right sibling representation Put the left child node to the node’sleft link Put the sibling to the node’s right link

A

B C D

E F G H I J

K L MUse a structure to link each node

A

B C D

N

E F G H I J

K L M

N

N NN

N

N NN

N NNN

N

N::=link to NULL

Left Child-Right Sibling Representation

Change to binary treeA

B C D

E F G H I J

K L M

Left Child-Right Sibling Representation

Change to binary treeA

BC D

E F G H I J

K L M

Left Child-Right Sibling Representation

Change to binary treeA

B

C

D

E F G H I J

K L M

Left Child-Right Sibling Representation

Change to binary treeA

B

C

D

E

F G H I J

K L M

Left Child-Right Sibling Representation

Change to binary treeA

B

C

D

E

F

G H I J

K L M

Left Child-Right Sibling Representation

Change to binary treeA

B

C

D

E

F

G H I J

K

L M

Left Child-Right Sibling Representation

Change to binary treeA

B

C

D

E

F

G H I J

K

L M

Left Child-Right Sibling Representation

Change to binary treeA

B

C

D

E

F GH I J

K

L M

Left Child-Right Sibling Representation

Change to binary treeA

B

C

D

E

F GH I J

K

LM

Left Child-Right Sibling Representation

Change to binary treeA

B

C

D

E

F G

H

I J

K

LM

Left Child-Right Sibling Representation

Change to binary treeA

B

C

D

E

F G

H

I J

K

L

M

Left Child-Right Sibling Representation

Change to binary treeA

B

C

D

E

F G

H

I

J

K

L

M

Left Child-Right Sibling Representation

Change to binary treeA

B

C

D

E

F G

H

IJ

K

L

M

top related