读书笔记之:C++ STL 开发技术导引-3
第17章 string基本字符序列容器
string常用 的函数
http://www.cplusplus.com/reference/string/string/
第18章 stack堆栈容器
堆栈是一种适配器
堆栈的实现
由于C++ STL中堆栈是不预设大小的,所以在入栈的时候就不考虑堆栈空间是否为满,均将元素压入到堆栈,从而函数没有标明入栈成功与否的返回值。
stack容器函数
http://www.cplusplus.com/reference/stl/stack/
第19章 queue队列容器
queue源代码
queue容器函数
http://www.cplusplus.com/reference/stl/queue/
第20章 priority_queue优先队列容器
priority_queue容器函数
http://www.cplusplus.com/reference/stl/priority_queue/
在priority_queue的实现中,主要采用了make_heap,push_heap和pop_heap三个函数。
make_heap函数将数组的元素重新排序,使之成为一个堆,完成堆的创建工作。push_heap是将新元素插入到堆中。pop_heap函数是将最大元素移到最后一个位置。并未真正的删除元素。
下面是代码: