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

Respuesta :

Answer:

D.Maintain a count of queue items.

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.