set、map、multiset、multimap四种关联式容器的内部都是由红黑树实现的。在STL中红黑树是一个不给外界使用的独立容器。既然是容器,那么就会分配内存空间(节点),内部也会存在迭代器。关于红黑树的一些性质,可以参考“数据结构”中的笔记,这里只记录STL中的红黑树是如何实现的。
和slist一样,红黑树的节点和迭代器均采用了双层结构:
节点:__rb_tree_no...
分类:
其他好文 时间:
2014-05-07 15:55:28
阅读次数:
487
vector : 向量
list : 双向链表容器,提供数据结构中链表的所有功能
queue : 队列容器,提供数据结构中队列的所有功能
stack : 栈容器,提供数据结构中栈的所有功能
deque : 双端栈容器,提供数据结构中栈的所有功能
priority_queue : 优先队列,一种按值排序的队列容器
set : 集合容器
multiset : 允许出现重复元素的集合容器
...
分类:
其他好文 时间:
2014-05-02 21:23:00
阅读次数:
298
Factorial Problem in Base K
Time Limit: 2 Seconds Memory Limit: 65536 KB
How many zeros are there in the end of s! if both s and s! are written in base k which is not necessarily to be 10...
分类:
其他好文 时间:
2014-05-02 20:11:29
阅读次数:
376