Java Ch. 17 Quiz
Stacks and Queues
Sign in to Google to save your progress. Learn more
In a queue, which element in the list would be popped? *
What is E in Java? *
Which Queue or Stack method does NOT use zero-indexing? *
If I fill a queue and a stack with the numbers 4, 59, 125(in that order), which number would be returned if I run peek()? *
Code for question below
Stack<Integer> example = new Stack<Integer>();
System.out.print(example.empty() + “ “);
example.push(1);
System.out.print(example.pop() + “ “ + example.empty());
What does the code above output? *
What would be the best use of a Queue? *
Submit
Clear form
This form was created inside of Irvine LIGHTS.