Question: C++ help: Implement a priority queue using heapify function in C++ using the requirements below and display the required output. -The program should be able

C++ help:

Implement a priority queue using heapify function in C++ using the requirements below and display the required output.

-The program should be able to insert, delete and update the priority of the jobs.

-Each job consists of Job #, Job Name, Submitter name, and priority.

-The jobs should be heapified or be sorted according to their priorities.

-Job priorities are to be assigned a number between 1 and 20.

-The program should take the job #, Job name, Submitter, and Priority as input into Wait Queue. Enter m jobs to "Wait Queue" where 10 < m < 15 not in sorted order.

-Display the "Wait Queue".

-Heapify (or Heap Sort) the Wait Queue and display the heapified or sorted "Wait Queue"

-Move the highest priority job from Wait Queue to Ready Queue (move 4 times)

-Heapify the "Wait Queue" each time the "Wait Queue" is changed.

-Heapify the "Ready Queue" each time the "Ready Queue" is changed.

-Display the result of both queues after 4 moves from "Wait Queue" to "Ready Queue". Also, delete 2 jobs from "Ready Queue" and display the result.

-Add 2 more jobs to "Wait Queue", move 3 jobs from "Wait Queue" to "Ready Queue", delete 1 job from "Ready Queue" and display the result.

-Change the priority of 2 jobs in the "Wait Queue" and display the result.

-You must do more deletions until no more jobs are in the "Wait Queue" and "Ready Queue".

Note: When you display the result, you must include the entire job information and not just the job #.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement a priority queue in C as per your requirements we will utilize a heap structure to effectively manage job priorities Lets break down the implementation step by step Step 1 Define the Job ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!