How these primary, secondary stacks are created?
can we use this is dequeue efficient class
Stack primary=new Stack();
Stack secondary= new Stack();
Queue using stack dequeue efficent
@minal.251298,
Use:
Stack primary = new Stack();
Stack Secondary = new Stack();
You can use the Stack class to create 2 objects of the stack class. 2 objects are primary and secondary. The type of the objects is Integer, that means they will store integer values.
one more doubt is if i am saving Dequeuefficient class in another file named dequeuefficient.java, it is showing Dequeuefficient.java:7: error: cannot find symbol Stack primary = new Stack(); ^ symbol: class Stack location: class Dequeuefficient