import java.io.*;
import stackp.stacks;
import queuep.queue;
import java.util.*;
public class pac
{
public static void main(String []args)
{
int op,ch,c,n,z,x,val;
Scanner s = new Scanner(System.in);
do
{
System.out.println("MENU\n 1.stack\n 2.queue\n 3.exit\n enter your option");
op=s.nextInt();
z=1;
switch(op)
{
case 1:System.out.print("stack operations");
System.out.println("\nenter the number of elements in the stack");
n=s.nextInt();
stacks st=new stacks(n);
while(z==1)
{
System.out.println("1.push\n 2.pop\n 3.display\n 4.exit\n enter your option");
ch=s.nextInt();
switch(ch)
{
case 1:System.out.println("enter element to push");
val=s.nextInt();
st.push(val);
break;
case 2:st.pop();
break;
case 3:st.display();
break;
case 4:z=4;
break;
}
}
z=1;
break;
case 2:System.out.print("Queue operations");
System.out.println("\nenter the number of elements in the queue");
n=s.nextInt();
queue q=new queue(n);
while(z==1)
{
System.out.println("\n1.enqueue\n2.dequeue \n3.display\n 4.exit\n enter your option");
c=s.nextInt();
switch(c)
{
case 1:System.out.println("enter element to enqueue");
x=s.nextInt();
q.enqueue(x);
break;
case 2:q.dequeue();
break;
case 3:q.display();
break;
case 4:z=4;
break;
}
}
z=1;
}
}while(op!=3);
}
}