This Priority Queue has the following requirements:
You may implement your Priority Queue contiguously (with an array), or dynamically (with a linked list), with the following restrictions:
O If you choose to go with array, don't set the capacity in the constructor. Instead, use an expression parameter (refer to Lab 7) to define the length of the array
O
If you go with a linked list, be careful with your memory management. Not only will you require a destructor, but it will likely need a recursive function
The Priority Queue must be templated
O
It will require a single typename parameter, to indicate what it holds
。 To that end, though you're free to use structs internally, you won't be using them from the client side, unless what's being held just happens to be structs
。 You'll have to write your enqueue method to accept two parameters: a T to store, and a long for its priority
0
This should go without saying, but because it's templated to hold any type, you obviously can't hardcode any stored types
e.g. if you start writing it to hold strings for testing purposes, make sure you remember to delete all occurrences of 'string' from the final version
As before, lower priority values have a higher priority for being removed
O
e.g. if you add ("eenie", 33), ("meenie", 20), and ("miney", 40), then the first element to be removed will be "meenie"
In addition to enqueue and dequeue, also add:
O A bool isEmpty()
O AT peek(), to return what the next dequeue will return, but without actually removing it from the Priority Queue
O An int count(), to return the current length of the Priority Queue
There should not be any cout (or cin) statements anywhere in your Priority Queue class!
Additionally, write a very simple program to demonstrate your Priority Queue.
For this client program, instantiate the Priority Queue to store std::strings, and let the user choose to add and remove as many elements as they wish (with whatever priorities they like), until they choose to quit.
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of