一、string
常用函数:clear()
length()
push_back()
append()
find() #返回的是一个指针
erase() #删除
二、vector
常用函数:push_back()
pop_back()
front() back()
insert()
erase()
size()
clear()
相比list优点:可以随机访问
三、queue(先进先出)类似于排队
常用函数:push()
pop()
front()
back()
size()
empty()
清空的方法:
queue<int> empty;
swap(empty,que);
四、stack(后进先出)
常用函数:
push()
pop()
top()
size()
empty()
(除top其余与queue用法类似)
五、map
map<string,int> 对应key和value键和值(默认按key排序)
常用函数:
erase()
find()
size()
clear()
count()
lower_bound()
upper_bound()
六、set集合(不存在重复元素)
常用函数:
insert()
erase()
find()
size()
clear()
count()
lower_bound(x):大于等于x的第一个元素位置,不存在返回end()
upper_bound(x):大于x的第一个元素位置,不存在返回end()