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"
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@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/