Question: Assume that you have an empty circular queue ( array - based implementation ) which can hold only four elements. What are the array indexes

Assume that you have an empty circular queue (array-based implementation) which can hold only four elements. What are the array indexes of the back and the front elements after executing this series of queue operations? (indexes start with 0)
enqueue("a"), enqueue("b"), getFront(), enqueue("e"), enqueue("d"), dequeue(), dequeue(), dequeue(), enqueue("a"), enqueue("b"), enqueue("c"), dequeue(), getFront(), enqueue("d"), dequeue
front index
back index

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!