set:不可重复集合,
构造: | set<int> Set; |
插入: | Set.insert(); |
查找 | Set.find(string); |
查找失败 | 返回值为Set.end();查找成功,返回值是该位置的下标 |
迭代器 | set<int> ::iterator it;可用作遍历集合,*it是元素,it是位置 |
删除: | Set.erase(it),一般就是删除find出来的it |
multiset,可重复元素集合:
构造 | multiset<int> Mul; |
插入 | Mul.insert(); |
查找 | Mul.find(string); |
查找失败 | 返回值为Mul.end(),查找成功后,返回下标 |
迭代器 | multiset<int>::iterator it;可用作遍历集合,*it是元素,it是位置 |
删除 | Mul.erase(it),一般就是删除find出来的it |