Question: Data structure 1 Queue Application Print Queue is where all received jobs and tasks are handled. The jobs are received from all connected devices on

Data structure

Data structure 1 Queue Application Print Queue is where all received jobs

and tasks are handled. The jobs are received from all connected devices

on the network. To add a level of control to the queue,

1 Queue Application Print Queue is where all received jobs and tasks are handled. The jobs are received from all connected devices on the network. To add a level of control to the queue, the jobs are send with unique priority; so the highest priority are served first. Exercise: Given the code of the Job struct, implement the print queue with the following functionalities: push: recieved jobs are added to the end of the queue. pop: the job with the highest priority is served fisrt. Its name should be returned. All cases must be handled. #include #include using namespace std; struct Job { int ID: string name int priority Job* next; Job(int ID, string name, int priority) { this->ID = ID; this->name = name; this->priority = priority: next = NULL; } class Printer { public: Printer() { 1 } void push(Job job) { } string pop() { } private Job* front; int main() { Printer p Job job1 = new Job(1"AA", 3); Job job2 = new Job(2, "BB", 2) Job* job3 = new Job(3, "CC", 4); Job* job4 = new Job(4, "DD", 1); P.push(jobi); P.push(job2); P.push(job3); P.push(jobt); cout using namespace std; struct Node { int ID: int key Node. left; Node. right; Node (int ID, int key { this->ID - ID: this->key - key: left = NULL; right - NULL; } class Tree public: Tree) { } bool insert(int PID, Node node) { } void print) } private: Node. root: }; int main() { Tree tree: Node* nodei - new Node(1, 5); Node* node2 - new Node (2, 17); Node* node3 - new Node(3, 23); Node* node4 = new Node (4, 15); cout 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!