Boost logo

Boost Users :

From: Matthias Kronenberger (mkronen_at_[hidden])
Date: 2002-09-02 03:47:42


You could chose to emulate such an tree using a std::multimap. Which maps
the father vertex id to the child vertices. you can also specify your own
ordering relation.
To access all children is trivial, if you want to access all grandchilds and
so own, you'd have to create a nice adapter class, that connects all
children of children ranges together.

----- Original Message -----
From: "Marc Cromme" <yg-boost-users_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.user
Sent: Friday, August 30, 2002 10:49 AM
Subject: n-ary ordered tree template in boost ??

> Dear Boost Members
>
> I was wondering if there is an n-ary ordered tree template in boost,
> something like
>
> template <size_t N, class Type, class Alloc = allocator<Type > >
> class NTree
>
> which is a standard container, and a reversible container, ordered
> by level. That is, first element is root, next series of elements
> are childs of roots, next series are grandchilds of root , and so
> on.
>
> This way one could parse level by level like a reversible container.
>
> There should be the obvious member functions for inserting/deleting
> child nodes and subtrees.
>
> As far as I can see, there is not such a template in boost, but the
> question is then:
>
> 1) can it be emulated using the grah library ??
>
> or
>
> 2) is there already an proposal/prototype for such a thing ??
>
> or
>
> 3) would it be interesting to include such a thing in boost ??
>
>
>
>
> your's sincierely,
>
>
> Marc Cromme
>
>
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net