Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem choosing collection…

Status
Not open for further replies.

d00ape

Programmer
Apr 2, 2003
171
SE
I’m about to store about 10-20.000 elements (MyType) in a collection. I would like to have some kind of order because I have to search for one or more elements quite often.

I’ve thought of a AVLTree which I am comfortable with. The problem is that I would like to enable multiple search and retrieve all successes in a list or something for future manipulations.

Pleased for all suggestions…


APe
 
AVL-tree is a very good choice (if you have a good implementation class or module). It seems you may try STL <map> or <multimap> (it has balanced tree implementation too). I can't say if its performance in speed/memory aspects is better than your AVL tree implementation - but it's standard, portable and (more or less) clear interface.
Use STL <list> or <vector> for result dataset.
In worst case you may write compact and working application (module) prototype with STL containers...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top