qingcheng奕  

2014年8月21日

摘要: http://www.cplusplus.com/reference/queue/priority_queue/priority_queue 的top始终保持着为一堆数据中的最大元素。读取最小 O(1)插入和删除 lg(n)(真是又简便又好用,难怪g不要我,当时连这个都不会写,sigh...)#in... 阅读全文
posted @ 2014-08-21 10:52 qingcheng奕 阅读(237) 评论(1) 推荐(0) 编辑
 
摘要: 在C++中,虽然堆不像 vector, set 之类的有已经实现的数据结构,但是在 algorithm.h 中实现了一些相关的模板函数。下面是一些示例应用http://www.cplusplus.com/reference/algorithm/pop_heap/#include #include ... 阅读全文
posted @ 2014-08-21 09:58 qingcheng奕 阅读(8492) 评论(0) 推荐(1) 编辑