📄 priorityqueue.h
字号:
#ifndef PRIORITY_QUEUE#define PRIORITY_QUEUE#include <map>#include <list>#include <set>#include <algorithm>using namespace std;class PriorityQueue{ public: PriorityQueue() { clear();} void clear(){queue.clear();} bool empty() {return queue.empty();} PP_Point* getNext() { PP_Point* next=(*queue.begin()).second; queue.erase(queue.begin()); return next; } void add(double q, PP_Point* p) { pair<double,PP_Point*> aux(q,p); queue.insert(aux); //queue[q].push_back(p); } private: multimap<double,PP_Point*> queue; // map<double,list<PP_Point*> > queue;};#endif/********************************************************************* * (C) Copyright 2006 Albert Ludwigs University Freiburg * Institute of Computer Science * * All rights reserved. Use of this software is permitted for * non-commercial research purposes, and it may be copied only * for that use. All copies must include this copyright message. * This software is made available AS IS, and neither the authors * nor the Albert Ludwigs University Freiburg make any warranty * about the software or its performance. *********************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -