Basic data structures: 1. Table 2. Stack 3. Queue 4. Tree 5. Hash
Let's take a look at the table:
Table definition: A table is actually a linked list strictly. A linked list is a collection of items. each item is a part of a node, and this node contains links to other nodes;
Table has two popular implementations in STL:
First,Vector).Vector provides an increasing array implementation for tables.The advantage is that the vector can be indexed in constant time. The disadvantage is that it is expensive to insert a new item or delete an existing item, unless these operations occur at the end of the vector.
Instead,List provides two-way table linked list implementation. The advantage is that the cost of inserting new items and deleting existing items is very small. The disadvantage is that list is not easy to index.
STL _ Data Structure