常用数据结构
- vector
- list
- map
- set
- stack
- queue
- deque
- priority_queue
vector
Vectors are same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being handled automatically by the container. Vector elements are placed in contiguous storage so that they can be accessed and traversed using iterators. In vectors, data is inserted at the end takes differential time, as sometimes there may be a need of extending the arry. Removing the last element takes only constant time because no resizing happens. Inserting and erasing at the beginning or in the middle is linear in time.
Vector in C++ STL
list
Lists are sequence containers that non-contiguous memory allocation. As