/** @return rear element of queue
* @return null if the queue is empty */
public Object getRearElement()
{
if (isEmpty())
return null;
else
return queue[rear];
}
/** insert theElement at the rear of the queue */
public void enqueue(Object theElement)
{
// Add your code here
}
/** remove an element from the front of the queue
* @return removed element */
public Object dequeue()
{
// Add your code here
}
please complete this java code its urgent
a) /** insert theElement at the rear of the queue */
b) /** remove an element from the front of the queue
* @return removed element */
Comments
Leave a comment