90.5k views
1 vote
In an array based implementationof a queue a possible solution to dealing with the full condition is to

A. All other answers

B. Check for frontIndex equal to backIndex

C.wait for an arrayFullException to be thrown

D. Maintain a count of queue items

User Leo White
by
5.8k points

1 Answer

4 votes

Answer:

D.Maintain a count of queue items.

Step-by-step explanation:

In array based implementation of queue we use two variables suppose frontindex and rearindex which points to the front of the queue and the rear of the queue respectively and one variable size to keep count of the variables in the queue So whenever we insert an element we insert it at rear index and whenever we remove an element we do it at front index.When the size becomes equal to the capacity of the array we can say that the queue is full.

User Greensuisse
by
6.6k points