Table of Contents
The data structures and ADTs we have looked at so far in this course
have been what are sometimes called sequential
containers - they maintain elements in a known sequence
and we access the elements by indicating a position in the sequence from
which we wish to obtain an element. Sometimes we indicate this position
a), sometimes symbolically (e.g.,
myVector.front()), but always, in order to get an element, we
have to know where it is in relation to the other elements.
Now we turn our attention to associative containers, ones in which the container's implementation maintains the elements in a sequence that is intended to allow rapid access to elements based upon their value.
This section of the course will be a bit different from the ones that have gone before. Previously, we have introduced an abstraction (vector, list, deque, etc) and also discussed how to implement it. The implementation of sets and maps is difficult enough, however, that we'll want to look at different possible underlying data structures, so for right now we'll only look at the set and map ADTs and how to use them, and we'll leave the implementation for later.