Consider the following statements for aString queue:
Queue Q = new Queue();
String x = "", y = "";
Show what is output by the following segment of code.
x = "g";
y = "e";
Q.enqueue(x + "8");
Q.enqueue(y);
x = Q.front( );
Q.dequeue( );
Q.enqueue(y + "5");
Q.enqueue(x);
y = Q.front();
Q.enqueue(y + "9");
System.out.println(“Queue Elements: “ + Q);
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here