|
Data Structures and Algorithms
with Object-Oriented Design Patterns in Python |
The abstract Tree class also provides default implementations
for two methods called depthFirstTraversal
and breadthFirstTraversal.
These methods are like the accept
method of the container class (see Section
).
Both of these methods perform a traversal.
That is, all the nodes of the tree are visited systematically.
Both of these implementations access abstract properties,
such as key,
and call abstract methods,
such as and getSubtree.
In effect, they are abstract algorithms .
An abstract algorithm describes behavior in the absence of implementation!