Given the queue X that results from Exercise, what would be the result of each of the following?
a. X.first();
b. Y = X.dequeue(); X.first();
c. Y = X.dequeue();
d. X.first()
Exercise
Hand trace a queue X through the following operations:
X.enqueue(new Integer(4));
X.enqueue(new Integer(1));
Object Y = X.dequeue();
X.enqueue(new Integer(8));
X.enqueue(new Integer(2))
X.enqueue(new Integer(5));
X.enqueue(new Integer(3));
Object Y = X.dequeue();
X.enqueue(new Integer(4));
X.enqueue(new Integer(9));
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.