C++类相关要点

set和unordered_Set
| 1 2 3 4 5 6 7
 | set<int> s1 = {1,2,3,4,5}; if (s1.find(3) != s1.end())   cout<<"Found it"<<endl;    unordered_set<int> s2 = {1,2,3,4,5}; if (s2.find(3) != s2.end())   cout<<"Found it"<<endl;
 | 
set.find() 的时间复杂度是O(nlog(n)),采用红黑树实现
unordered_set.find() 的时间复杂度通常是常数,采用哈希实现,当哈希结果不好时会退化到线性