간단 한 우선 순위 대기 열 구현
1887 단어 데이터 구조
#ifndef _PRIORITY_
#define _PRIORITY_
#include
#include"../Heap/Heap.h"
using namespace std;
templatepublic :
PriorityQueue():MyHeap()
{}
~PriorityQueue()
{}
PriorityQueue(const PriorityQueue>pq)
{
MyHeap=pq.MyHeap;
}
PriorityQueue>operator=(const PriorityQueue>pq)
{
if(&pq!=this)
{
MyHeap=pq.MyHeap;
}
}
size_t size()
{
return MyHeap.size();
}
bool empty()
{
return MyHeap.empty();
}
void push(const T>key,const U>value)
{
}
void pop()
{
}
U>top()
{
}
private:
heap#endif
이상
만약 당신 이 어떤 생각 이나 개선 할 수 있 는 부분 이 있다 면,나 와 교류 하 는 것 을 환영 합 니 다!
전체 코드 및 테스트 용례 는 github 에 있 습 니 다.
본문 은 www.sbrave.cn 에서 최초 로 발표 되 었 다.
【끝】