1. Six major components of STL
Containers
Allocators
Algorithms
Iterators
Adapters
Functors
2. The container is an interval that is closed before and after opening
[ ) c.begin() points to the 0th element c.end() points to the one after the last element
3. Classification of container structure
(1) Serial container
Array(c++ 11)
Vector
Deque
List
Forward_List(C++ 11)
(2) Associative container
Set
Multiset
Map
Multimap
(3) Unordered container (C++11)
Unordered Set
Unordered Multiset
Unordered Map
Unordered Mulitmap
4. Use containers
(1) array() fixed container size
(2) vecotr() applies twice the memory size
each time (3) list() applies for one storage unit of memory
each time (4) forward_list() applies for one storage unit each time (5) slist
() #include<ext/slist> = forward_list()
(6) deque() expands one buffer at a time
(5) stack() internal implementation is deque()
(7) queue() internal implementation is deuque()
(8) multiset() value repeatable red-black tree implementation
(9) multimap() key value repeatable, red-black tree implementation
multimap<long, string> c;
(10) unordered_multiset() hash table implementation
(11) unordered_multismap() hash table implementation
(12) map() red-black tree
(13) set() red-black tree
(14) unordered_map() hash table
(15) unordered_set() hash table
5. Object-oriented OOP and generic programming thinking GP
OOP binds data and methods together
GP separates data and methods, and calls them through iterators to be as general as possible
All algorithms are internally operated by the elements themselves, which is the ratio of size