|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ø |
Use
an explicit List class as well as a Node class
|
|
|
or
structure
|
|
|
Ø |
pval() then is a List, rather than a
pointer to Node
|
|
Ø |
print_preorder()
or other routines that traverse the
|
|
|
tree
would need some way to efficiently step
|
|
|
through
the nodes in the list.
|
|
|
|
– |
I.e.,
don’t actually destroy the list using Pop()
|
|
|
|
– |
You
could let the List() give you it’s first node, or you
|
|
|
could
define a list iterator type as described in the
|
|
|
textbook.
|
|