C++ STL容器 set使用
来源:互联网 发布:网贷平台源码 编辑:程序博客网 时间:2024/06/03 23:46
set也是一个关联性容器,底层实现是红黑树,我们可以往容器里面放数据,系统会给我们每一个数据分配一个键值。
#include <stdarg.h>#include <stdio.h>#include <iostream>#include <vector>#include <string.h>#include <algorithm>#include <stdlib.h>#include<memory>#include <string.h>#include <set>using namespace std;int main(){set<int> se;se.insert(3);se.insert(6);se.insert(5);se.insert(6);//当插入相同的元素的时候,插入不进去set<int>::iterator it;/* set会自动排序,默认是升序 */for (it = se.begin(); it != se.end(); it++){cout << (*it) << endl;}system("PAUSE");return 0;}
下面是STL容器源码剖析给出的一个示例:
0 0
- C++STL练习<queue> <set>容器使用
- C++--STL---set容器
- c++STL Set集合容器
- C++STL之set容器
- STL容器使用DEMO-set
- C++ STL容器 set使用
- STL容器Set的使用
- c++STL容器使用
- C++STL之关联容器【map】【set】
- C++STL之Set集合容器
- C++::STL::容器类::set/multiset
- STL容器Set和Multisets使用
- STL — set容器的使用详解
- C++STL中的set容器和map容器
- C++STL容器使用经验总结
- C++STL容器使用经验总结
- C++STL容器使用经验总结
- C++STL容器使用经验总结
- 三层
- Nginx配置文件nginx.conf中文详解(总结)
- java反射机制
- C++ STL之stack queue 作者csdn账号 liuhmmjj
- iOS-Core-Animation-Advanced-Techniques(四-1)
- C++ STL容器 set使用
- 文章标题
- POJ 1469 解题报告
- 当自己的英雄
- apk反编译和重新打包
- iOS-Core-Animation-Advanced-Techniques(三)
- iOS提交AppStore后申请加急审核
- unicode字符编码前补上u
- HDU1281(二分图最大匹配)