Question: Implement a generic ADT PriorityQueue.cpp and PriorityQueue.h using C++ templates and a single linear linked list A priority queue is a queue in which items
Implement a generic ADT PriorityQueue.cpp and PriorityQueue.h using C++ templates and a single linear linked list
A priority queue is a queue in which items are stored in an order determined by a numeric priority value; where a task with priority 1 comes before a task with priority 2. This interpretation means lower numerical value has a higher priority. Thus, a priority queue is not a FIFO structure.
Implement the functions provided within the table
Note: Queue Node is defined as a struct:
struct QueueNode{
ItemType info; int priority;
QueueNode * next;};
Here is an example of how it output would look like:
left is input and right is >>>>>>> output

Enqueue0 Adds value at the appropriate position in the queue as determined by the numerio value priority. As in conventional English usage, lower numeric values correspond to a higher urgency, so that a task of priority 1 comes before a task with priority 2. If the Removes the value at the front of the queue and returns it to the caller. Calling ameter is it defaults to on a e throws an Peek0 Returns the value of the most urgent item in the queue without removing it from ue throws an Calling peek on an priority of the most PeekPriority 0 Returns the urgent item removing it from in the queue without throws arn MakeEmm GetLen PrintQueue0 Prints Queue items ordered from front to rear the queue. Calling peek on an emp Removes all elements from the Returns the number of elements currently in the IsEmpty 0 Returns true if the queue is empty and false otherwise IsFull 0 Returns true if the queue is full and false otherwise
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
