priorityqueue.h
来自「一个非常有用的客户端开发程序」· C头文件 代码 · 共 46 行
H
46 行
#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 + =
减小字号Ctrl + -
显示快捷键?