c++容器 set()
简介:set容器,插入的时候会自动排序
本质:底层是二叉树实现
set和multiset区别,set不允许有重复的数字
使用:
#include<set>
set<T> st;
set& operator = (const set &st)
遍历的时候
for(set<int>::iterator it = s.begin();it! = s.end();it++){ }
简介:set容器,插入的时候会自动排序
本质:底层是二叉树实现
set和multiset区别,set不允许有重复的数字
使用:
#include<set>
set<T> st;
set& operator = (const set &st)
遍历的时候
for(set<int>::iterator it = s.begin();it! = s.end();it++){ }