Question: Queue Develop a class to represent a Queue ( Single ended ) You may use either a dynamic array OR a linked list as an

Queue
Develop a class to represent a Queue (Single ended) You may use either a dynamic array OR a
linked list as an underlying implementation.
Required Public Methods:
Queue()
Default Constructor. Should set up any underlying data structures used to implement the queue.
Enqueue(Qtype item)
Inserts the item at the end of the queue.
Qtype Dequeue()
Removes and returns the item at the front of the queue. This should fail if the queue is empty
Qtype Peek()
Returns the value of the item in the front of the queue. Note that this should NOT remove the
item.
int Size()
Returns the number of elements in the queue

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!