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
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/
You can simply use a multimap, better the hash_multimap.
No I can't! Sorry because of not mentionning the right thing. I can't because the objects I needed are not ordered.
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.
Does the method you mentioned work for my problem in which there is no ordering? If yes, please explain it in more detail (with an example). Thank you, --Hossein __________________________________ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com
participants (2)
-
Hossein Haeri
-
Matthias Kronenberger