Boost logo

Boost :

From: Samuel Krempp (krempp_at_[hidden])
Date: 2002-10-10 16:00:48


le Thursday 10 October 2002 22:14, tslettebo_at_[hidden] écrivit :

>
> R
> / \
> / \
> L1 R1
> / \
> / \
> L2 R2
>
> I thought common names for this was (at least it's used in books on
> algorithms and data structures):

great, I did not have a book dealing with trees handy, to check this my
self.
 
> Pre-order (children before parent): L2-R2-L1-R1-R
> Post-order (children after parent): R-L1-L2-R2-R1
> In-order: L2-L1-R2-R-R1
> Level-order: L2-R2-L1-R1-R (or starting from the root)
>
> How does this relate to depth-first, breadth-first, etc.?

I think "depth-first" usually reffers to Pre-order.
While it is more natural for iterators to do Post-order (and so does
kasper's code)

breadth-first is Level-order (starting from root is again more natural, but
it's the same if reversing the list, and inversing left and right..)

-- 
Sam
Enlever les mots en trop dans mon e-mail pour répondre

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk