jds.util
Class PostorderTreeTraversal
java.lang.Object
|
+--jds.util.PostorderTreeTraversal
- public class PostorderTreeTraversal
- extends java.lang.Object
- implements java.util.Enumeration
PreorderTreeTraversal - traverse a binary tree in preorder fashion;
for use with book
Classic Data Structures
in Java
by Timothy A Budd,
published by Addison-Wesley, 2001.
Method Summary |
boolean |
hasMoreElements()
see if enumeration has at least one more element |
java.lang.Object |
nextElement()
return the next element in the enumeration |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
PostorderTreeTraversal
public PostorderTreeTraversal(BinaryNode root)
- initialize a traversal rooted at given node
- Parameters:
root
- start of traversal
hasMoreElements
public boolean hasMoreElements()
- see if enumeration has at least one more element
- Specified by:
- hasMoreElements in interface java.util.Enumeration
nextElement
public java.lang.Object nextElement()
- return the next element in the enumeration
- Specified by:
- nextElement in interface java.util.Enumeration
- Returns:
- the value of the current element