Database
aa0011.txt
Associated article: A Generic Iterator for Tree Traversal
Tags: Database Parallel Design
Published source code accompanying the article by Alexander Ananiev in which he discusses generic tree traversal logic that can be used with any type of tree-like structure or tree node, letting you focus on the application logic rather than the internals of the tree structure organization.
Algorithm Alley
by Alexander Ananiev
Example 1:
if ( levelIter.hasChildren() ) {
levelIter=levelIter.nextLevel();
}
Object nextElt=null;
// if there are more siblings at the current level
if ( levelIter.hasMoreElements() )
nextElt=levelIter.nextElement();
// the entire level has been processed--go to the parent level
...


