Question: Question 4 [ 1 0 points ] : In Module 5 lectures, we discussed the abstract data type Queue. A queue is a collection of

Question 4[10 points]: In Module 5 lectures, we discussed the abstract data type Queue. A queue is a collection of
items where the addition of new items happens at one end (tail) and the removal of existing items occurs at the other
end (head)(FIFO). Use the Node class (an object with a data field and a pointer to the next element) to implement the
queue data structure with the following operations:
Queue() creates a new queue that is empty. It needs no parameters and returns nothing (constructor)
enqueue(item) adds a new Node with value=item to the tail of the queue. It needs the value of the Node and
returns nothing.
dequeue() removes the head Node from the queue. It needs no parameters and returns the value of the Node
removed from the queue. The queue is modified.
isEmpty() tests to see whether the queue is empty. It needs no parameters and returns a boolean value.
 Question 4[10 points]: In Module 5 lectures, we discussed the abstract

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!