What I am doing is taking data from an XML file and storing it in the data structure which I want to be able to access later for further computation. Once the data has been extracted from the XML file and added to the data structure which would then be placed in some kind of container I will not be adding or moving around elements. Is a linked list still the best container for this?
Why do you use resize with an empty vector? I think you could reserve memory as much as i can think it would br needed and after filling the vector you could free unused memory of the vector. For example
1 2 3 4 5 6 7 8 9 10
std::vector <struc_t> structures;
structures.reserve( 1000 );
while ( true )
{
struc_t s;
// filling the structure
structures.push_back( s );
// other code and testing the condition to leave the loop
}
As for selection of an appropriate container I think you should take into acccount searching of elements. Do you need a sequential searching or binary searching? Maybe you need std::multimap<std::string>, struc_t>?
I will be searching through the elements to find those elements with a specific property. Some elements will have a certain symetry (call it sym1) whereas others will have sym2. I will be dealing with only those that has sym2.