What are associate containers?- Containers are objects that hold other objects. An associative container stores pair of values. It is typically a key-value pair. Given one value (key), we can access the other, called the mapped value. The key needs to be unique. The value associated with that key could be unique or multiple depending upon the type of associative container.
- The key-value pair could be of any data type (unlike integer in case of array).
- There are various types of associative containers:
- Map : It is a traditional associate array, where a single value is associated with each unique pair.
- Multimap : This type of associative array allows duplicate elements (value) for a given key.