I study data structures and I want to ask what are the equivalents of STL containers.
for example
The Standard Template Library (STL) is a set of C++ template classes to provide common programming data structures and functions such as lists, stacks, arrays, etc. It is a library of container classes, algorithms, and iterators.
The STL SequenceContainer types are: array represents a static contiguous array. vector represents a dynamic contiguous array. forward_list represents a singly-linked list.
Concering the C++ standard library containers, the standard itself tries not to say too much about implementation. However, the very specific constraints on complexity of insertion, removal, look-up, range insertion and so on, mean that most implementations use the same types of data structures for the containers. Concerning some of your examples:
I believe the STL follows these implementations.
I don't think qualifying std::map<> as just a "pair" would be correct. Actually, there is a utility named std::pair<> which is really only just a pair. std::map<> stores unique keys and non-unique values in a way that makes it possible to use a syntax similar to that of an array with indices being of types that can be numerical or not.
Edit: Corrected "container" to "utility" thanks to juanchopanza.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With