1.
a.
3
1
4
2
6
5
9
7
b.
4
1
6
2
5
9
7
2.
a.
C
X
G
B
Y
P
A
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
b.
This is the only way to make such a binary tree because the entire tree can only be drawn
this way to represent both inorder and preorder. For example for the right edge you can
do it differently for just inorder but because it has to be the same as preorder you have
to put the node p on the right child of node g. Since inorder is starting from the left it
ensures node P is last.
c.
The method I used was going node by node and fitting them in. I knew C would have to
be the root node because it was the first in preorder.
Next I knew the farthest left node
was going to have to be node B to satisfy inorder. I made X the parent node of B to also
satisfy inorder and knew that my left most edge was complete because it satisfied both in
and preorder. Next I knew I had to place A and Y in the left side of the tree because C
was my root node. The next part was easy because with preorder there are more ways to
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 M.McCullen
 Graph Theory, root node

Click to edit the document details