Question: what are the logical errors in the method /** * Adds a new value at the tail of the queue * * @param item element
/** * Adds a new value at the tail of the queue * * @param item element to be inserted at the tail of the queue * @exception QueueOverflowException full queue */ public void enqueue (T item) { if (size >= MAX_SIZE) { throw new QueueOverflowException(); } data[last] item; last++; if (last >= MAX_SIZE) { last = first; } size++; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
