Question: language is C++ Implement a Priority Queue(PQ) using an UNSORTED LIST. Use an array size of 10 elements. Use a circular array: Next index after

language is C++

Implement a Priority Queue(PQ) using an UNSORTED LIST. Use an array size of 10 elements. Use a circular array: Next index after last index is 0. Add the new node to next available index in the array. When you add an element,add 1 to index (hit max index, go to index 0). Test if array in full before you add. When you remove an element, from the list, move the following elements to the left to fill in the blank, etc ( Like prior program done with LISTS )

Create a class called Node: Have a Name and Priority.

Data set - 10 is the highest priority, 1 is lowest priority.

Enqueue and dequeue in the following order.

Function Name, Priority

Enqueue Joe, 3

Enqueue Fred,1

Enqueue Tuyet,9

Enqueue Jose, 6

Dequeue

Enqueue Jing, 2

Enqueue Xi, 5

Enqueue Moe, 3

DequeueEnqueue Miko, 7

Enqueue Vlady, 8

Enqueue Frank, 9

Enqueue Anny, 3

DequeueEnqueue Xi, 2

Enqueue Wali, 2

Enqueue xChe, 6

Enqueue xVerra, 8

Dequeue

Dequeue

Dequeue

Dequeue

Dequeue

Dequeue

Dequeue

Dequeue

Dequeue

Dequeue

Dequeue

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!