摘要: 1set容器set容器简介:set是一个容器,它用于储存数据并且能从一个数据集合中取出数据。它的每个元素的值必须惟一,而且系统会根据该值来自动将数据排序。每个元素的值不能直接被改变。关键字:begin、clear、count、empty、end、find、insert需加载的头文件:#include模板原型:template , class Allocator=allocator >说明: ... 阅读全文
posted @ 2013-08-23 13:39 /bin 阅读(3937) 评论(0) 推荐(0) 编辑
摘要: priority_queue调用 STL里面的 make_heap(), pop_heap(), push_heap() 算法实现,也算是堆的另外一种形式。先写一个用 STL 里面堆算法实现的与真正的STL里面的 priority_queue用法相似的priority_queue, 以加深对 priority_queue 的理解。#include #include #include using namespace std;class priority_queue{private:vector data;public:void push( int t ){data.push_back(t);pu 阅读全文
posted @ 2013-08-23 13:30 /bin 阅读(199) 评论(0) 推荐(0) 编辑