Loading…

What values do top, removed, and the new peek() get? Enter them separated by spaces.

Deque<String> stack = new ArrayDeque<>();
stack.push("A");
stack.push("B");
stack.push("C");

String top = stack.peek();
String removed = stack.pop();
String next = stack.peek();

Exercise review

Mentor
We can discuss the current task or any algorithms theory. I’ll help you understand it and find the next step.
Sign in to use the Mentor The Mentor uses the current exercise and your conversation history.
Sign in