Question: IN JAVA, instructor does not allow to change the methods, so solution should be written with the same method into myqueueDriver.java Resct Editor HW5_P1 Queue
IN JAVA, instructor does not allow to change the methods, so solution should be written with the same method into myqueueDriver.java

Resct Editor HW5_P1 Queue using two stacks Implement a MyQueue class which implements a queue using fwo stacks Compiler: Java private int maxCepecity-4 private Stack String> sack1 private Stack Sting stack2 MyteueDrberjaae.jaa Note: .You can use library Stack but you are not allovwed to use library Queue and any of 2 Impore java.1ang.* its methods Your Queue should not accept null or empty String or space as an input 3 Impore java.1o. s public class NyQueueDriver { public static vozdma String[] args You need to implement the following methods using two stacks (stack1 & stack2) and also you can add more methods as well: pubic void insert String value) oubic String remave private void shltstacks) pubi baalean IsEmpty) pubic baalean isfull HyQueueDew HyDueuet Scanner input - new Scanner(Systen.in)i int whichInput.nextInta Fwhich test case int qaaneity- D uber of elenenta to asd in the qeue if(which quantityinput.nextIne Stringt lenents-nev stringl quantity): tor(int 1-0:i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
