Question: Queues Write a Java program that implements a doubly-linked list version of a priority dequeue that allows insert and delete operations at either end and

Queues Write a Java program that implements a doubly-linked list version of a priority dequeue that allows insert and delete operations at either end and maintains highest priority toward the front. Each node in your linked dequeue must contain the following data items. Class DNode { int data; int priority; DNode next; DNode previous; . . . methods . . . } Your dequeue class must contain the following methods. constructor // creates the dequeue and initializes private variables clear // clears the dequeue insertBack // inserts a new integer at the back of the dequeue insertFront // inserts a new integer at the front of the dequeue deleteBack // deletes an integer from the back of the dequeue, assuming dequeue is not empty deleteFront // deletes an integer from the front of the dequeue, assuming dequeue is not empty print // print the contents of the dequeue (one int per line) Data Structure Illustration [ data, priority ] back <--> [ 3, 2 ] <--> [ 7, 4 ] <--> [ 12, 6 ] <--> [ 15, 10 ] <--> front Your solution must include a node class, a dequeue class, and a main "test" class containing operations that will exercise each of the dequeue methods. 

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!