Question: Create a class myQueueADT that implements the queue functions using a circular array implementation. Make sure the implementation keeps track of all necessary variables like

Create a class myQueueADT that implements the queue functions using a circular array implementation. Make sure the implementation keeps track of all necessary variables like the front and rear indices and the size of the queue. The functions to implement are: 1. qSize size() Returns the size of the queue. 2. emptyFlag isEmpty() Returns true if the queue is empty and false if not. 3. fullFlag isFull() Returns true if the queue is full and false if not. 4. firstInQ peek() Returns the value of the first element in the queue. Returns -1 if the queue is empty. 5. enqueue(elementValue) Adds a new element elementValue to the end of the queue. 6. firstInQ dequeue() Removes the first element in the queue and returns its value. Returns -1 if the queue is empty.

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 Programming Questions!