容器
有以下多种容器:
1、数组(array)
2、动态数组(dynamic array)
3、链表(linked list)
4、栈(stack)
5、队列(queue)
6、双向队列(deque)
7、优先级队列(priority queue)
8、树(tree)
9、二叉查找树(binary search tree)
10、二叉堆(binary heap)
11、字典(dictionary)
12、集合(set)
13、图(graph)
14、有向无环图(directed acyclic graph)
容器操作:
1、插入(insert)
2、移除(remove)
3、顺序遍历(sequential access)
4、随机遍历(random access)
5、查找(find)
6、排序(sort)
使用迭代器(iterator)的好处:
1、直接读取会破坏容器类的封装性,迭代器是容器类的友元。
2、迭代器简化了迭代过程。