Question: 5) For the question below, fill in initial values for instance variable and then fill in the method body of the enqueue() method. Use the
5) For the question below, fill in initial values for instance variable and then fill in the method body of the enqueue() method. Use the extra sheet to complete the enqueue method if needed.
class ArrayQueue{
//instance variables
int head ;
int tail ;
int listsize;
int mysize;
Object [] QueueList;
//constructor method
publicArrayQueue(int size){
mysize = size
QueueList = new Object[mysize];
int head = ____; //Fill in the initial value for head
int tail =_____; //Fill in initial value for tail
int listsize=______//this variable is optional no need to fill it in
}
//instance methods
//return true if Queue is empty false otherwise
public boolean isEmpty() { return false;}
//return true if Queue is full false otherwise
public boolean isFull(){return false; }
/**
*
*
*/
public void enqueue (Object item) {
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
