10
3. SEE
4. NEVER
0
101
9
78
5. PURPLE
11. SAW
11
12
6. NEVER 12. HOPE
Figure 7.23
16. Give the sentence that results from doing a preorder
search of the tree.
17. Give the sentence that results from doing an inorder
search of the tree.
18. Give the sentence that results from doing a postorder
search of the tree.
In Exercises 19 and 20, evaluate the expression, which is given
in Polish, or prefix, notation.
19. $x + 34 - 72 \div 12 \times 3 - 64$
3.
$-x \times 3 \times x \times 4 \times y + 15 \times 2 - 6 \times y$, where $x$ is 2 and $y$ is
In Exercises 21 through 24, evaluate the expression, which is
given in reverse Polish, or postfix, notation.
21. $4 \times 3 \times 2 - 5 \times 4 \times 2 \times 5 \times 3 + +$
22. $3 \times 7 \times 4 - 9 \times 6 \times 5 \times 2 + +$
23. $x \times 2 - 3 + 2 \times 3 \times y + w \times 3 - x +$, where $x$ is 7, $y$ is 2,
and $w$ is 1.
24. $7 \times x \times y - 8 \times x \times w + x$ where $x$ is 7, $y$ is 2, and $w$ is 1.
25. Draw a binary tree whose preorder search produces the
string JBACDIHEGF.
32.
R
Fi
L
Figur
In Exercises
linked-list re
Draw the dig
ally stored in
is the binary
33.
INDEX
1
2
3
4
5
string CATSANDDOGS.
26. Draw a binary tree whose preorder search produces the
6
7
string SEARCHING.
27. Draw a binary tree whose postorder search produces the
8
9
10
C
string TREEHOUSE.
28. Draw a binary tree whose postorder search produces the
11
a
12
0
Search