???????????????????????????????????????????????????? ?μ?C++ Primer
????1.STL????
????1?????????????Sequence containers????????????й??λ??????????????????????????????vector??deque??list??
????Vectors??????????????????????м????????????????????????????????????????β??????????????????????????в???????????????????
????Deques????“double-ended queue”????д????????????????????????????????????????β????????????????????????????в???????????????????
????Lists????????????????????????????????????????O(n)???????κ?λ??????в???????????????????????????????????
????2?????????????Associated containers???????λ???????????????????????????????set??multiset??map??multimap??
????Sets/Multisets????????????????????????Set??????????????????????Σ?Multisets???????????????????????????????????????????????(RB-tree????????????????
????Maps/Multimaps??Map????????????/??????????????????????????Map??????????????????????Σ?Multimaps???????????????????????????????????????????????(RB-tree????????????????
??????????????????hash_map??hash_set??hash_multiset??hash_multimap??
?????????????
????Vector Deque List Set MultiSet Map MultiMap ????? dynamic array array of arrays double linked list binary tree binary tree binary tree binary tree ?????? Yes Yes No No No Yes(key) No ??????? ?? ?? ???? ?? ?? ?? ?? ?????????? β?? ??β ?κ?λ?? -- -- -- --
????2.STL??????
????Iterator???????????????Cursor???α?????????????????????????????????и???????
??????????豩????????????????????????????????????Iterator???????????????????????????????????????????????????????????????????£?????????????iterator???????????????????е????????
????????????????????????????????????????????????????????????????????????*??????????????????????????????????????????????????????????????????????????
???????????Щ???????????iterator??const_iterator??reverse_iterator??const_reverse_iterator
???????????????????????
????vector<T>::iterator it;
????list<T>::iterator it;
????deque<T>::iterator it??

????#include <stack> template < typename T?? typename Container=deque > class stack;
?????????????????????????vecotr??deque(???)??list?е??κ???????stack????????
????bool stack<T>::empty()                               //?ж?????????
????void stack<T>::pop()                                 //???????????
????stack<T>::push(T x)                                  //??????????
????stack<T>::size_type stack<T>::size()                 //??????????
????T stack<T>::top()                                    //??????????
?????????????
????stack<int> intDequeStack; 
????stack<int??vector<int>> intVectorStack; 
????stack<int??list<int>> intListStack;
??????2??queue?÷?
????#include <queue>
????template<typename T?? typename Container = deque<T> > class  queue;
???????????????????queue?д洢?????????????????漲queue???????????????????????????dequeue??list??????????????????dequeue??
????C++??STLqueue<T>::push(T x) void queue<T>::pop() T queue<T>::back() T queue<T>::front() queue<T>::size_type queue<T>::size() bool queue<T>::empty() C++??STLqueue<int> intDequeQueue; queue<int??list<int>> intListQueue;
??????3??priority_queue?÷?
????#include <queue>
????template <typename T?? typename Container = vector<T>?? typename Compare = less<T> > class priority_queue;
????priority_queue?????????У?????????????????С???????????FIFO??????????λ??????????????и?????????????????????????????????????????????????е???????FIFO???塣????????????????vector??????????deque??list??????????priority_queue??????????????????????????
????C++??STLpriority_queue<T>::push(T x) void priority_queue<T>::pop() T priority_queue<T>::top() priority_queue<T>::size_type priority_queue<T>::size() bool priority_queue<T>::empty() C++??STLpriority_queue< int?? vector<int>?? greater<int> > priority_queue< int?? list<int>?? greater<int> >
???????????????????????<??????????????????????????????÷????????????????http://www.cnblogs.com/vvilp/articles/1504436.html??
??????????е?????÷?????????????<??????????????????????????????
????priority_queue<int> qi;
??????????????????9 6 5 3 2
??????????е?????÷???????priority_queue???????????????????functional.h???????????????????
????priority_queue<int?? vector<int>?? greater<int> >qi2;
???????2???????????2 3 5 6 9
??????????е??????÷?????????????????
????C++??STLstruct node { friend bool operator< (node n1?? node n2) { return n1.priority < n2.priority; } int priority; int value; }; priority_queue<node> qn;  C++??STL
?????????3???????????
????????? ?
????9 5
????8 2
????6 1
????2 3
????1 4
??????y??У?value????priority????????????????operator<???????????????е??????????????????????<?????????У???????????е?<?????????>?????????