Answers to Self-Study Questions for Trees

Test Yourself #1

general tree using linked lists

Test Yourself #2

In each line, the front of the queue is at the left.

A
B C
C D
D E F
E F
F G
G H I
H I
I

Test Yourself #3

(a) Preorder:

A B D H E I C F J K G

(b) Postorder:

H D I E B J K F G C A

(c) Level-order:

A B C D E F G H I J K

(d) In-order:

D H B I E A J F K C G