Use Deque as stack
Java
Easy
6 views
Problem Description
Task: implement a small stack using Deque and support push/pop/peek.
Output Format
Return value
Constraints
Use ArrayDeque.
Official Solution
static java.util.Deque<Integer> newStack(){return new java.util.ArrayDeque<>();}
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!