NestedSet - Traversing a tree _nonrecursively_
| From: | Marco Schuler | Date: | Tue, 05 Aug 2003 08:56:48 +0000 |
| Subject: | NestedSet - Traversing a tree _nonrecursively_ | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-7002@lists.php.net to get a copy of this message | ||
Hello
I need to implement a Iterator-class for a NestedSet. Since there should
be a methode next() that gives me the values of a node, I have to
traverse the tree _nonrecursively_ . My idea was to program a helper
class Stack that would help me implementing my nonrecursiv iterator. I
am not sure if this is a good solution.
Any hints for a performant algorithm are welcome!
Thanks!
--
cu
Marco