C ++ learning transcript 4 and learning transcript 4
1. Container = Data Structure + algorithm. It is equivalent to designing something specifically used to store the complex data. It is used to transmit complex data during development. 2. The template function can only be written in the header file. It cannot be declared separately. 3. STL containers are classified into three types: (1) ordered containers are vector arrays. Fast query, but slow insertion. The added data sequence depends on the size. Deque array. It is slower than vector query, but insert is a little faster than deque. Hash ing is used. List. Fast insertion, slow query (2), and associated containers: The biggest difference with the sequential container class is that the content of the container class is irrelevant to the order of addition, and will be sorted during insertion. Set elements cannot be repeated. You can repeat map key-value pairs (attribute files are composed of key-value pairs). They are stored in key-value pairs. Duplicate key names are not allowed. The storage is ordered. The multimap and map are sorted by the key, but they can be repeated (3). Container adapter stack queue priority_queue