Create a program that demonstrates the functions of the LinkedQueue class.
For this project, we will create a data structure known as a queue. A queue can be thought of as a line. Items are added at the end of the line and are taken from the front of the line. You will create a class LinkedQueue based on one of the linkedlist classes given in this chapter. It should have private attributes for
• front—a reference to the first node in the linked list of queue items
• count—the number of items in the queue
and the following operations:
• addToQueue(item)—adds item to the end of the queue. (Add it at the end
of the linked list.)
• removeFromQueue()—removes the first item from the queue and returns it. If the queue is empty, returns null.
• isEmpty—returns true if the queue contains no items; otherwise, returns false.
This program is just a simple modification of the existing programs in this chapter. The solution is loosely based on the generic version of the linked list given in Listing 12.12.
See the code in LinkedQueue.java, LinkedQueueDemo.java.
You might also like to view...
What is a sentinel in a sentinel-controlled loop?
What will be an ideal response?
In a producer/consumer relationship with a single cell of shared memory, which of the following is true?
a. The consumer must run first. b. The producer must run first. c. The producer must run first or the consumer will have to wait. d. The consumer must run first or the producer will have to wait.
Output devices are used to enter data for processing.
Answer the following statement true (T) or false (F)
What is the incorrect action and why does it occur?
Specification: Write out Hello World twenty-five times. Each hello begins a new line.
```
#include