In this assignment, we will be building a simulation of a job scheduling and processing system. The purpose of the simulation is to be able to run simulations in order to compare their performance, when they use different queuing disciplines in order to .

Create a PriorityQueue class and implement a new enqueue() method to implement a priority queuing

discipline. For efficiency, priority queues are often implemented using a heap, so that both insertion and removal

of items can be done in O(log n) time. However, we are going to use a simple naive method and simply insert

new items into a link list that we keep sorted by priority. Doing this means that the insertion (enqueue())

operation becomes O(n), but since for a priority queue we always want the next item with the highest priority

for a dequeue(), dequeue() is still O(1) constant time, since we will keep items ordered by priority and the

highest priority item in the queue should always be at the front of the list.

This may sound like a lot, but there is really not too much to do to get a basic priority queue working. You

need to perform the following steps

1. Create a new class called PriorityQueue that inherits (using public inheritance) and derives from the

LQueue class. This class still needs to be a template class, as it needs to be able to handle queues of

different types of objects. I have set the member variables of the LQueue class to be protected, which

means that your PriorityQueue class methods will be able to access and refer to the queueFront and

queueBack member variables. You should insert your class definition for your PriorityQueue at the end

of the “Queue.hpp” file.

The only method you need to implement/override is the enqueue() method. All other methods should work

correctly using the LQueue() implementations you will inherit. But since you are overriding enqueue()

you do need to put a new declaration for this function in your PriorityQueue class declaration, but this

will be the only function or variable (re)defined in the PriorityQueue.

2. Once you have the declaration working, you will need to create your implementation of the enqueue()

method for the PriorityQueue. As we already mentioned, instead of always just inserting the new

item/node at the back of the queue, you instead need to do some some extra work and insert the new node

into the linked list at the proper position so that the linked list is ordered by priority. You can assume that

the objects inserted into a PriorityQueue are overloaded so that boolean comparisons (like operator<,

operator<=, operator>, etc.) are defined to order object by their priority. The Job class that you will be

managing with your PriorityQueue has had these operators defined to order jobs by their priority level.

The pseudo-code for the algorithm your enqueue() function needs to perform

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
The price is based on these factors:
Academic level
Number of pages
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!