Write a PriorityQueue class, which is implemented atop a givenheap structure.
template< typename Comparable,class Container >
class PriorityQueue {
protected:
Container t;
public:
voidpush(const Comparable & x);
voidpop(); ;
constComparable& top();
voidprint();
voidclear(); ;
boolisEmpty();
};
—-
- Implement a Ticket class with the following attributes. Itshould also implement comparison operators.
- ID
- Priority – 1 to 10
- Description
- Status – {New, In Progress}
- Create an instance of PriorityQueue in main with Ticket ascomparable and BinaryHeap
as a container.
PriorityQueue<Ticket,BinaryHeap<Ticket>> pq;
Expert Answer
Answer to Write a PriorityQueue class, which is implemented atop a given heap structure. template< typename Comparable, class Cont...