maxpriorityqueue.h

来自「datastucutre and algorithms, application」· C头文件 代码 · 共 27 行

H
27
字号
// abstract class max priority queue
// all methods are pure virtual functions

#ifndef maxPriorityQueue_
#define maxPriorityQueue_

using namespace std;

template<class T>
class maxPriorityQueue 
{
   public:
      virtual ~maxPriorityQueue() {}
      virtual bool empty() const = 0;
                  // return true iff queue is empty
      virtual int size() const = 0;
                  // return number of elements in queue
      virtual const T& top() = 0;
                  // return reference to the max element
      virtual void pop() = 0;
                  // remove the top element
      virtual void push(const T& theElement) = 0;
                  // add theElement to the queue
};
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?