I need help with which type of container should I use...
I need the data in the array to be :
- Quick for insert and delete as well ( cause the program tend to do that alot )
- The program iterate always from the index 0 to some point in array usually not until the end
The basic difference : vector,map and list????? And usage of map (if possible)??
vector mimics an array. it's designed for fast access of the single element. insert/delete of a particular element is rather slow.
list is desinged for fast insert/delete of an element. accessing a particular element is not as fast as vector.
map is somehow a combination of vector and list. It's designed to access a particular element via a key. The key can be of any type (if the key was an index it would appear like a vector (not time wise of course)). It is sorted according to the key, hence the key needs to be comparabel with <