Vector vs. Map- Vectors are used to store contiguous elements like an array. However, unlike arrays, vectors can be resized. Maps on the other hand contain unique key/value pairs and sorted by keys. - For example, a telephone guide where a key would be the name initial and value will be the number.Vector vs. Map:In a vector, all the elements are in a sequence whereas Map stores element in the form of a key-value association pair.
|