We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Queue using Two Stacks
Queue using Two Stacks
Sort by
recency
|
505 Discussions
|
Please Login in order to post a comment
For Java 7.
import java.util.Scanner; import java.util.Stack;
class Queue { Stack getIn = new Stack<>(); Stack getOut = new Stack<>(); int size = 0;
}
public class Solution { public final static Scanner sc = new Scanner(System.in);
Typescript with two queues
perl: