Answers to Self-Review Exercises

21.1

a) referential.

b) stack.

c) predicate.

d) first-in, first-out (FIFO).

e) link.

f) garbage collection.

g) queue.

h) tree

i) last-in, first-out (LIFO).

j) binary.

k) root.

l) child or subtree.

m) leaf.

n) inorder, preorder, postorder.

o) -d.

p) class loader.

q) -classpath, CLASSPATH.

r) package declaration.

21.2 It’s possible to insert a node anywhere in a linked list and remove a node from anywhere in a linked list. Nodes in a stack may be inserted only at the top of the stack and removed only from the top.

21.3 A queue is a FIFO data structure that has references to both its head and its tail, so that nodes may be inserted at the tail and deleted from the head. A stack is a LIFO data structure that has ...

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.