traverse : Java Glossary


To visit the nodes of a tree. There are three common ways of doing it. Consider the following tree:
 /   \
B     C
Then post-order would process in the order: B, C, A. Pre-order would go: A, B, C. In-order would go: B, A, C. You can have depth first searches where you visit the children of a child before the siblings of a child. This is most easily done with recursion. You can have breadth first searches where you visit all your children before you visit any of your children’s children. This is usually done with a queue to track unvisited relatives.

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number