Java Reference
In-Depth Information
on the internet
Many of the examples discussed in this chapter are explored in Chapter 19,
where we discuss binary search trees. Consequently, the only code available is
for the iterator classes.
BinaryNode.java
Contains the BinaryNode class.
BinaryTree.java
Contains the implementation of BinaryTree .
TestTreeIterators.java
Contains the implementation of the
TreeIterator hierarchy.
exercises
IN SHORT
18.1
For the tree shown in Figure 18.33, determine
a.
Which node is the root
b.
Which nodes are leaves
c.
The tree's depth
d.
The result of preorder, postorder, inorder, and level-order traversals
For each node in the tree shown in Figure 18.33
a.
18.2
Name the parent node
b.
List the children
c.
List the siblings
d.
Compute the height
e.
Compute the depth
f.
Compute the size
figure 18.33
Tree for Exercises
18.1 and 18.2
A
B
C
D
E
F
G
H
I
J
K
LM
 
Search WWH ::




Custom Search