There are three types of sequential container vector,list,deque in STL. Performance description for each of them
Vector
The inside of the vector is managed by a continuous dynamic array of memory, each push_back an element and placed at the end of the array.
This way, through continuous memory space management, we can easily go through the subscript index to the value, at the end of the insertion and deletion of the efficiency is very high.
When inserting and deleting inside the vector, it causes the vector container element to move to the position, so the performance is poor
Deque
Deque is a double-ended queue that inserts and deletes elements at the end of the line. When deleted at the end of the high efficiency, in the middle position will lead to moving position, inefficient
List
Double-ended linked list, insert and delete just move the internal pointer position, so very fast, find the words need to go through the previous element in turn, poor performance
C + + STL sequence container advantages and disadvantages records