STL包括vector、list、deque、set、multiset、map、multimap、stack、queue、priority_queue。
vector/deque是线性容器,表现为动态一维数组;
list是线性容器,表现为双向链表;
set是排序的关联容器,其表现为有序的唯一键;
multiset与set的区别是允许重复键;
map是排序的关联容器,其表现为有序的唯一键,以及与该键关联的一个值;
multimap与map的区别是允许重复键。
stack、quque、priority_queue是适配器。
static和queue默认使用的是deque;priority_queue默认使用的是vector。
STL
STL includes vector, list, deque, map, set, multimap, multiset, stack, queue, priority_queue.
The vector/deque is a sequence container that represents an abstraction of a dynamic one dimensional array.
The list is a sequence container that represents an abstraction of a doubly linked list.
The set is a sorted associative container that represents an abstraction of an ordered unique key.
The multiset is a sorted associative container that represents an abstraction of an ordered non-unique key. The only difference between set and multiset is that a multiset is allowed to have duplicate keys.
The map is a sorted associative container that represents an abstraction of an ordered unique key, with a related value.
The multimap is a sorted associative container that represents an abstraction of an ordered non-unique key. The only difference between map and multimap is that a multimap is allowed to have duplicate keys.
The queue is FIFO. The stack is FILO. The stack and queue use deque. The priority_queue uses vector.