[jdom-interest] Tree Traversal Without Recursion

bob mcwhirter bob at werken.com
Sat Nov 18 04:56:43 PST 2000

> I'm trying to find an example for walking a JDOM tree without recursion.

If you're really just trying to walk a tree without recursion,
pickup a copy of Knuth or any other algorithms book, and it'll
show you how to walk a tree with a stack, instead of recursive
function calls.

> This code should be capable of finding an element anywhere in the tree.
> Thanks in advance.

If you're just trying to find an Element, and don't really care if
the implementation uses recursion, maybe you'd like XPath.
As always...


-bob mcwhirter

More information about the jdom-interest mailing list