--- a/docs/Writerside/topics/tree.h.md Fri Oct 17 15:04:56 2025 +0200 +++ b/docs/Writerside/topics/tree.h.md Fri Oct 17 16:53:24 2025 +0200 @@ -348,7 +348,8 @@ void cxTreeVisitorDispose(CxTreeVisitor *visitor); ``` -There are two different kinds of iterators for trees. +There are two different kinds of iterators for trees: one for depth-first iteration and one for breadth-first iteration. + The `CxTreeIterator` is performing a depth-first iteration with the capability of visiting a node twice: first when the iterator enters the node coming from its parent, and secondly when the iterator tracks back from its last child. This behavior is controlled via the `visit_on_exit` argument. @@ -357,6 +358,8 @@ On the other hand, the `CxTreeVisitor` performs a breadth-first iteration and visits every node only once. +Both iterators do not support the removal of nodes. + Since tree iteration needs to keep track of a stack (depth-first) or queue (breadth-first), internal memory is allocated. This memory is _automatically_ disposed of when the iteration _completes_. If you break from the iteration early, you must call `cxTreeIteratorDispose()` or `cxTreeVisitorDispose()`, respectively, to deallocate the memory.