Cover Data Structures and Algorithms with Object-Oriented Design Patterns in Java
next up previous contents index

Tree Traversals

 

Program gif introduces the AbstractTree class. The AbstractTree class extends the AbstractContainer class introduced in Program gif and it implements the Tree interface defined in Program gif. The AbstractTree class provides default implementations for both the depthFirstTraversal and breadthFirstTraversal methods. Both of these implementations call abstract methods such as getKey and getSubtree. In effect, they are abstract algorithms . An abstract algorithm describes behavior in the absence of implementation!




next up previous contents index

Bruno Copyright © 1998 by Bruno R. Preiss, P.Eng. All rights reserved.