<div class="gmail_quote">On Tue, Nov 10, 2009 at 16:07, BLS <span dir="ltr">&lt;<a href="mailto:windevguy@hotmail.de">windevguy@hotmail.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On 10/11/2009 11:18, Lutger wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
- how to do ranges over a tree?<br>
My first thought was that a tree would define preorder / inorder / postorder<br>
ranges, and then perhaps visitors for more complex algorithms.<br>
</blockquote>
<br>
<br></div>
I asked the same question quit a while ago... I think we have to imagine a tree&#39;s branch as sub range. ( In other words, treat them like linear structures)<br>
<br>
How to implement it? I dunno.<br></blockquote><div><br>I had a Tree (and Graph) struct some month ago. In another module, I defined depthFirst(Tree t) and breadthFirst(Tree t) functions, which just returned a lazy range (a struct, as always), iterating in a depth-first/breadth-first way on t. Except having them as methods of Tree/Graph, how would you do it?<br>
<br></div></div>