CS210 Tutorial 8
Complete the following exercises pasted below:
Q1. Draw a binary tree representation for the following sequence
((5+2)*(2−1))/(3-1)*8
Q2. For the above binary tree, write the output for Pre-order, In-order and Post-order traversal.
Q3. Consider the following arithmatic expression. Draw a Binary tree for this expression. Evaluate the expression using In-Order traversal and give the results as an integer value.(((4+4)+2)*(3*(7-5)))
Q4. Draw a binary tree with the following conditions
Each internal node of T stores a single character.
A pre-order traversal of T yields EXAMFUN.
An in-order traversal of T yields MAFXUEN.
Q5. Assuming that a binary tree is implemented using an array of characters, draw this binary tree for the following information available in the array
K |
C |
B |
M |
F |
R |
T |
O |
W |
Q |
P |
S |
Y |
L |
X |
H |
G |
M |
M |
B |