implementation without an item count the inclusion of the field nitems in the queue class imposes slight overhead on the insert(and remove(methods in that they must respectively increment and decrement this variable this may not seem like an excessive penaltybut if you're dealing with huge numbers of insertions and deletionsit might influence performance accordinglysome implementations of queues do without an item count and rely on the front and rear fields to figure out whether the queue is empty or full and how many items are in it when this is donethe isempty()isfull()and size(routines become surprisingly complicated because the sequence of items may be either broken or contiguousas we've seen alsoa strange problem arises the front and rear pointers assume certain positions when the queue is fullbut they can assume these exact same positions when the queue is empty the queue can then appear to be full and empty at the same time this problem can be solved by making the array one cell larger than the maximum number of items that will be placed in it listing shows queue class that implements this no-count approach this class uses the no-count implementation listing the queue class without nitems class queue private int maxsizeprivate long[quearrayprivate int frontprivate int rear//public queue(int /constructor maxsize + /array is cell larger quearray new long[maxsize]/than requested front rear - //public void insert(long /put item at rear of queue if(rear =maxsize- rear - quearray[++rearj//public long remove(/take item from front of queue