Boost logo

Boost Users :

From: Matthias Kronenberger (yg-boost-users_at_[hidden])
Date: 2003-06-06 01:20:11


You can simply use a multimap, better the hash_multimap.

To represent a tree, enumerate your knots. For every father knot, map its id
to the id of its childreen ( and maybee additional data)
A knot that cannot be found in the map, is a leaf.
I you want to traverse the tree in the leaf to root direction, simply create
a predecessor map (using a simple vector for example). That map stores the
father for each child.

"Hossein Haeri" <powerprogman_at_[hidden]> schrieb im Newsbeitrag
news:20030603192232.12595.qmail_at_web10802.mail.yahoo.com...
> Dear all,
>
> I need to have some template doing the jobs of an
> ordinary BST (Binary Search Tree). Nothing that fancy,
> but something at the level we all have been educated
> in CS1/FCS1, or similar courses. Does boosts
> repository
> contain such an object?
>
> Why don't I write it myself? Simply, because I want to
> optimise the time!
>
> Thank you,
> --Hossein
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
>
>
> Info: <http://www.boost.org>
> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
> Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


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