sec queues front front rear ( (brear figure the circular queue with array positions increasing in the clockwise direction (athe queue after the initial four numbers and have been inserted (bthe queue after elements and are deletedfollowing which and are inserted through use of the modulus operator (denoted by in javain this waypositions in the array are numbered from through size- and position size- is defined to immediately precede position (which is equivalent to position size sizefigure illustrates this solution there remains one more seriousthough subtleproblem to the array-based queue implementation how can we recognize when the queue is empty or fullassume that front stores the array index for the front element in the queueand rear stores the array index for the rear element if both front and rear have the same positionthen with this scheme there must be one element in the queue thusan empty queue would be recognized by having rear be one less than front (taking into account the fact that the queue is circularso position size- is actually considered to be one less than position but what if the queue is completely fullin other wordswhat is the situation when queue with array positions available contains elementsin this caseif the front element is in position then the rear element is in position size- but this means that the value for rear is one less than the value for front when the circular nature of the queue is taken into account in other wordsthe full queue is indistinguishable from the empty queueyou might think that the problem is in the assumption about front and rear being defined to store the array indices of the front and rear elementsrespectivelyand that some modification in this definition will allow solution unfortunatelythe problem cannot be remedied by simple change to the definition for front and rearbecause of the number of conditions or states that the queue can be in ignoring the actual position of the first elementand ignoring the actual values of the elements stored in the queuehow many different states are therethere can