Dslall 13 Code
Dslall 13 Code
grpA=[]
grpB=[]
grpC=[]
for i in range(0,q):
p=input("\nEnter Name::")
grpA.append(p)
for i in range(0,q):
p=input("\nEnter Name::")
grpB.append(p)
for i in range(0,q):
p=input("\nEnter Name::")
grpC.append(p)
c1=[ ]
c2=[ ]
c3=[ ]
c4=[ ]
c=[ ]
def f1():
for i in grpA:
for j in grpB:
if i==j:
c1.append(i)
return c1
def f2():
for i in grpA:
if i not in grpB:
c2.append(i)
for j in grpB:
if j not in grpA:
c2.append(j)
return c2
def f3():
s=[ ]
for i in grpC:
if i not in grpA:
s.append(i)
for j in s:
if j not in grpB:
c3.append(j)
return c3
def f4():
c=[ ]
for i in grpA:
if i not in grpB:
c.append(i)
for j in grpC:
if j not in grpC:
c4.append(j)
for k in grpC:
if k not in grpB:
c4.append(k)
return c4
while(1):
print("1] students who play cricket and badminton::\n2]students who play either cricket
or badminton not both::\n3]students who play neither cricket nor badminton::\n4]students who
play cricket or football but not badminton::\n ")
if (c==1):
print(f1())
elif(c==2):
print(f2())
elif(c==3):
print(f3())
elif(c==4):
print(f4())
else:
def s1():
long = []
s = str1.split()
for i in s:
long = i
def s2():
e = str1.count(d)
def s3():
a = str1[::-1]
if(a == str1):
else:
print(a, " string is not a palindrome string")
def s4():
b = str1.find(c)
def s5():
words = str1.split()
words.sort()
occ=1
prev = words[0]
if(words[i] != prev):
prev = words[i]
occ = 1
else:
occ += 1
print("6 : Exit")
if(func==1):
p=s1()
elif(func==2):
q=s2()
elif(func==3):
r=s3()
elif(func==4):
s=s4()
elif(func==5):
t=s5()
else:
break
def accept_matrix(M) :
c = int(input("\tcol = "))
for i in range(r) :
A = []
A.append(int(input()))
M.append(A)
def display_matrix(M,r,c):
for i in range(r) :
print("\t\t",end=' ')
for j in range(c):
print("%3d"%M[i][j],end=' ')
print("")
def addition_matrix(M1,M2,M3,r,c) :
for i in range(r) :
A = []
for j in range(c):
A.append(M1[i][j] + M2[i][j])
M3.append(A)
def substraction_matrix(M1,M2,M3,r,c) :
for i in range(r) :
A = []
for j in range(c):
A.append(M1[i][j] - M2[i][j])
M3.append(A)
def multiplication_matrix(M1,M2,M3,r1,c1,c2) :
for i in range(r1) :
A = []
for j in range(c2) :
sum = 0
for k in range(c1) :
A.append(sum)
M3.append(A)
def find_transpose_matrix(M,r,c,T) :
for i in range(c):
A = []
for j in range(r):
A.append(M[j][i])
T.append(A)
def main():
while True :
print("\t\t\t7: Exit");
M3 = []
if (ch == 7):
break
elif (ch==1):
M1 = []
M2 = []
accept_matrix(M1)
r1 = len(M1)
c1 = len(M1[0])
r2 = len(M2)
c2 = len(M2[0])
elif (ch==2):
display_matrix(M1,r1,c1)
display_matrix(M2,r2,c2)
elif (ch==3):
display_matrix(M1,r1,c1)
display_matrix(M2,r2,c2)
addition_matrix(M1,M2,M3,r1,c1)
print("\tAddition ")
display_matrix(M3,r1,c1)
else :
elif (ch==4):
display_matrix(M1,r1,c1)
substraction_matrix(M1,M2,M3,r1,c1)
print("\tSubstraction ")
display_matrix(M3,r1,c1)
else :
elif (ch==5):
display_matrix(M1,r1,c1)
display_matrix(M2,r2,c2)
if(c1 == r2) :
multiplication_matrix(M1,M2,M3,r1,c1,c2)
print("\tMultiplication ")
display_matrix(M3,r1,c2)
else :
elif (ch==6):
display_matrix(M1,r1,c1)
find_transpose_matrix(M1,r1,c1,M3);
display_matrix(M2,r2,c2)
M3 = []
find_transpose_matrix(M2,r2,c2,M3);
display_matrix(M3,c2,r2)
else :
main()
quit()
def accept_array(A):
for i in range(n):
A.append(x)
return n
def display_array(A,n):
if(n == 0) :
else :
for i in range(n) :
print("\n");
def Linear_Search(A,n,X) :
for i in range(n) :
if(A[i] == X) :
def Sentinel_Search(A,n,X) :
last = A[n-1]
i=0
while(A[i] != X) :
i = i +1
A[n-1] = last
if( (i < n-1) or (X == A[n-1]) ) :
else :
def Main() :
A = []
while True :
if (ch == 4):
quit()
elif (ch==1):
A = []
n = accept_array(A)
display_array(A,n)
elif (ch==2):
flag = Linear_Search(A,n,X)
if(flag == -1) :
else :
elif (ch==3):
flag = Sentinel_Search(A,n,X)
if(flag == -1) :
else :
else :
Main()
def accept_array(A):
for i in range(n):
A.append(x)
n = len(A)
if(n == 0) :
else :
for i in range(n) :
print("\n");
def Selection_sort(A) :
n = len(A)
min_ind = pos
for i in range(pos + 1, n) :
min_ind = i
temp = A[pos]
A[pos] = A[min_ind]
A[min_ind] = temp
def Bubble_sort(A) :
n = len(A)
for i in range(n-Pass) :
temp = A[i]
A[i] = A[i+1]
A[i+1] = temp
def Main() :
A = []
while True :
print ("\t3 : Bubble sort Descending order and display top five scores")
if (ch == 4):
quit()
elif (ch==1):
accept_array(A)
display_array(A)
elif (ch==2):
Selection_sort(A)
display_array(A)
elif (ch==3):
display_array(A)
Bubble_sort(A)
display_array(A)
if(len(A) >= 5) :
for i in range(5) :
print("\t%.2f"%A[i])
else :
for i in range(len(A)) :
print("\t%.2f"%A[i])
else :
Main()
#6th quick sort
def accept_array(A):
for i in range(n):
A.append(x)
def display_array(A):
n = len(A)
if(n == 0) :
else :
for i in range(n) :
print("\n");
def partition(A,s,l) :
b=s+1
e=l
while(e>=b) :
while(A[s] <A[e]) :
e=e-1
if(e>b) :
temp = A[e]
A[e] = A[b]
A[b] = temp
temp = A[s]
A[s] = A[e]
A[e] = temp
return e
def Quicksort(A,s,l) :
if(s<l) :
mid = partition(A,s,l)
Quicksort(A,s,mid-1)
Quicksort(A,mid+1,l)
def Main() :
A = []
while True :
print ("\t2 : Quick sort ascending order and display top five scores")
if (ch == 3):
quit()
elif (ch==1):
A = []
accept_array(A)
display_array(A)
elif (ch==2):
display_array(A)
n =len(A)
Quicksort(A,0,n-1)
display_array(A)
if(n >= 5) :
for i in range(n-1,n-6,-1) :
print("\t%.2f"%A[i])
else :
for i in range(n-1,-1,-1) :
print("\t%.2f"%A[i])
else :
print ("Wrong choice entered !! Try again")
Main()
#include<iostream>
#include <string.h>
#include<stdlib.h>
private:
char p[10],n[10];
SNode *next;
public:
SNode();
char* getPrn();
char* getName();
void setData(char val[],char name[]);
SNode *getNext();
};
strcpy(p,"");
strcpy(n,"");
next = NULL;
char* SNode::getPrn(){
return p;
char* SNode::getName(){
return n;
strcpy(p,val);
strcpy(n,na);
}
SNode *SNode::getNext(){
return next;
next = n;
private:
SNode *start;
public:
LinkedList();
void printList();
start = NULL;
int ch;
char key[10];
if(Search(data))
return 0;
cout<<"\n1. Insert President at start :\n2. Insert member after a specific member :\n3.
Insert Secretary at end:\n";
cin>>ch;
pNew = new SNode(); //Allocate memory
else
switch(ch)
case 1:
break;
cin>>key;
pPre = pTemp;
pTemp= pTemp->getNext();
if(pTemp!=NULL)
pNew->setNext(pTemp->getNext());
pTemp->setNext(pNew);
else
break;
pTemp= pTemp->getNext();
pTemp->setNext(pNew);
break;
}
return 0;
int LinkedList::Count(){
if(pTemp==NULL)
return 0;
else {
int cnt=0;
while(pTemp!=NULL)
cnt++;
pTemp = pTemp->getNext();
return cnt;
delete(pTemp);
start=NULL;
return 1;
else
if(strcmp(pTemp->getPrn(),key)==0)
break;
pPre = pTemp;
pTemp= pTemp->getNext();
start = start->getNext();
else
pPre->setNext(pTemp->getNext());
delete pTemp;
return 1;
return 0;
while(pTemp!=NULL)
if (strcmp(pTemp->getPrn(),key)==0)
cout<<"\t"<<pTemp->getPrn()<<"\t"<<" ";
cout<<"\t"<<pTemp->getName()<<"\t"<<" ";
return 1;
pTemp = pTemp->getNext();
return 0;
}
void LinkedList::printList(){
if(pTemp==NULL)
else
while(pTemp->getNext()!=NULL)
cout<<"|"<<pTemp->getPrn()<<"|"<<pTemp->getName()<<"->";
pTemp = pTemp->getNext();
cout<<"|"<<pTemp->getPrn()<<"|"<<pTemp->getName();
void LinkedList::concatenate(LinkedList l)
{ cout<<"\n in concatenate:";
SNode *pTemp=start;
while(pTemp->getNext()!=NULL)
pTemp=pTemp->getNext();
pTemp->setNext(l.start);
int main()
LinkedList list,list2;
char data[10],n1[10];
int n,n2,choice;
do
// system("cls");
<<"\n4. Search"
<<"\n9. Exit";
switch(choice)
case 1:
//Insert
list.Insert(data,n1);
break;
case 2://Delete
cin>>data;
int ret;
ret=list.Delete(data);
if(ret==1)
else{
break;
case 3://count
cout<<list.Count();
break;
case 4://Search
cin>>data;
if(list.Search(data))
cout<<"\nItem Found";
else
break;
break;
case 6:
list2.Insert(data,n1);
list2.printList();
break;
list2.printList();
break;
case 8: //concatenation
list.concatenate(list2);
list.printList();
break;
case 9:
cout<<"\nThank you";
exit(0);
break;
default:
cout<<"\nWrong Choice";
return 0;
#include<iostream>
struct node
{ int roll;
};
class info
{ node
*head1=NULL,*temp1=NULL,*head2=NULL,*temp2=NULL,*head=NULL,*temp=NULL,*h1=NULL,
*head3=NULL,*temp3=NULL;
int c,i,f,j,k;
public:
node *create();
void insert();
void allstud();
void vanila();
void butters();
void uice();
void nice();
void notice();
void ovanila();
void obutters();
void display();
void notboth();
};
node *info::create()
cin>>c;
p->roll=c;
p->next=NULL;
return p;
void info::insert()
node *p=create();
if(head==NULL)
{ head=p;
else
{ temp=head;
while(temp->next!=NULL)
{ temp=temp->next; }
temp->next=p;
void info::display()
{ temp=head;
while(temp->next!=NULL)
{ cout<<"\n"<<temp->roll;
temp=temp->next;
} cout<<"\n"<<temp->roll;
}
void info::allstud()
cin>>k;
head=NULL;
for(i=0;i<k;i++)
{ insert();
h1=head;
} display();
head=NULL;
void info::vanila()
cin>>k;
head=NULL;
for(i=0;i<k;i++)
{ insert();
head1=head;
} display();
head=NULL;
}
void info::butters()
cin>>j;
for(i=0;i<j;i++)
{ insert();
head2=head;
} display();
head=NULL;
void info::uice()
temp1=head1;
while(temp1!=NULL)
p->roll=temp1->roll;
p->next=NULL;
if(head3==NULL)
{ head3=p;
else
{ temp3=head3;
while(temp3->next!=NULL)
{ temp3=temp3->next; }
temp3->next=p;
temp1=temp1->next;
temp2=head2;
while(temp2!=NULL)
{ f=0;
temp1=head1;
while(temp1!=NULL)
if(temp2->roll==temp1->roll)
{ f=1; }
temp1=temp1->next;
if(f==0)
p->roll=temp2->roll;
p->next=NULL;
if(head3==NULL)
{ head3=p;
else
{ temp3=head3;
while(temp3->next!=NULL)
{ temp3=temp3->next; }
temp3->next=p;
temp2=temp2->next;
temp3=head3;
while(temp3->next!=NULL)
{ cout<<"\n"<<temp3->roll;
temp3=temp3->next;
} cout<<"\n"<<temp3->roll;
void info::ovanila()
while(temp1!=NULL)
{ temp2=head2;
f=0;
while(temp2!=NULL)
{ if(temp1->roll==temp2->roll)
{ f=1; }
temp2=temp2->next;
if(f==0)
{ cout<<"\n"<<temp1->roll; }
temp1=temp1->next;
void info::obutters()
temp2=head2;
while(temp2!=NULL)
{ temp1=head1;
f=0;
while(temp1!=NULL)
{ if(temp2->roll==temp1->roll)
{ f=1; }
temp1=temp1->next;
if(f==0)
{ cout<<"\n"<<temp2->roll; }
temp2=temp2->next;
void info::nice()
temp1=head1;
while(temp1!=NULL)
{ temp2=head2;
while(temp2!=NULL)
{ if(temp1->roll==temp2->roll)
{ cout<<"\n"<<temp1->roll; }
temp2=temp2->next;
}
temp1=temp1->next;
void info::notice()
temp=h1;
while(temp!=NULL)
{ temp3=head3;
f=0;
while(temp3!=NULL)
{ if(temp->roll==temp3->roll)
{ f=1; }
temp3=temp3->next;
if(f==0)
{ cout<<"\n"<<temp->roll; }
temp=temp->next;
}
void info::notboth()
temp1=head1;
while(temp1!=NULL)
{ temp2=head2;
f=0;
while(temp2!=NULL)
{ if(temp1->roll==temp2->roll)
{ f=1; }
temp2=temp2->next;
if(f==0)
{ cout<<"\n"<<temp1->roll; }
temp1=temp1->next;
temp2=head2;
while(temp2!=NULL)
{ temp1=head1;
f=0;
while(temp1!=NULL)
{ if(temp2->roll==temp1->roll)
{ f=1; }
temp1=temp1->next;
if(f==0)
{ cout<<"\n"<<temp2->roll; }
temp2=temp2->next;
int main()
{ info s;
int i;
char ch;
do{
cout<<"\n 7. To display the rollno of student who like both vanila and butterscotch ";
cout<<"\n 8. To display the rollno of student who neither like vanila nor butterscotch";
cout<<"\n 9. To display the rollno of student who either like vanila or butterscotch but not
both";
cin>>i;
switch(i)
{ case 1: s.allstud();
break;
case 2: s.vanila();
break;
case 3: s.butters();
break;
case 4: s.uice();
break;
case 5: s.ovanila();
break;
case 6: s. obutters();
break;
case 7: s.nice();
break;
case 8: s.notice();
break;
case 9: s.notboth();
break;
cin>>ch;
}while(ch=='y'||ch=='Y');
return 0;
#include<iostream>
#include<conio.h>
#include<stdlib.h>
#define size 5
class STACK_CLASS
private:
struct stac{
int s[size];
int top;
}st;
public:
STACK_CLASS();
int stfull();
int stempty();
int pop();
void display();
};
STACK_CLASS::STACK_CLASS(){
st.top=-1;
for(int i=0;i<size;i++)
st.s[i]=0;
int STACK_CLASS::stfull(){
if(st.top>=size-1)
return 1;
else
return 0;}
void STACK_CLASS::push(int item){
st.top++;
st.s[st.top] =item;
int STACK_CLASS::stempty(){
if(st.top ==-1)
return 1;
else
return 0;
int STACK_CLASS::pop(){
st.top--;
return(item);
void STACK_CLASS::display(){
int i;
if(stempty())
else{
for(i=st.top;i>=0;i--) {cout<<"\n"<<st.s[i];}
};}
int main(){
int item,choice;
char ans;
STACK_CLASS obj;
do
cout<<"\n1.Push\n2.Pop\n3.Display\n4.exit";
cin>>choice;
switch(choice)
case 1:
cin>>item;
if(obj.stfull())
else
obj.push(item);
break;
case 2:if(obj.stempty())
{item=obj.pop();
break;
case 3:obj.display();
break;
case 4:exit(0);};
ans=getche();
getch();
return 0;
#include<iostream>
#include<math.h>
#include<string.h>
{
char p; // operator stack
stack *next;
public:
stack()
r = 0;
next = NULL;
void setval(float x)
r = x;
float getval()
return r;
void setchar(char x)
p = x;
char getchar()
return p;
}
stack* getnext()
return next;
next = t;
};
stack *top;
int j;
char *post;
char *in;
public:
intopos()
j = 0;
in = new char[20];
top = NULL;
}
stack* gettop()
return top;
top = w;
char pop();
float pop1();
void op();
int isp();
void disp();
void eva();
void eva1();
};
void intopos::push(char x)
{
stack *nn;
nn = new stack();
nn->setchar(x);
if(top == NULL)
settop(nn);
else
nn->setnext(gettop());
settop(nn);
char intopos::pop()
if(top == NULL)
cout<<"EMPTY";
return '\0';
else
{
stack *t;
t = gettop();
settop(gettop()->getnext());
char z = t->getchar();
t->setnext(NULL);
delete t;
return z;
int intopos::icp(char x)
if(x == '(')
return 4;
return 1;
return 2;
return 4;
else if(x == ')')
return -1;
return -2;
int intopos::isp()
if(gettop() != NULL)
char x = gettop()->getchar();
if(x == '(')
return 0;
return 1;
return 2;
return 3;
else //operand
return -3;
return -4;
void intopos::op()
int a, b, l, v = 0;
char x;
cin>>l;
cin>>x;
in[v] = x;
v++;
in[v] = '\0';
v = 0;
while(v < l)
a = isp();
b = icp(in[v]);
if(b == -2)
post[j] = in[v];
j++;
else if(b == 4 || b == 2 || b == 1)
push(in[v]);
else
while(b <= a)
post[j] = pop();
j++;
push(in[v]);
while(gettop()->getchar() != '(')
post[j] = pop();
j++;
char c = pop();
while(gettop() != NULL)
char c = pop();
if(c != '(')
post[j] = c;
j++;
}
}
void intopos::disp()
cout<<post[w];
cout<<endl;
stack *nn;
nn = new stack();
nn->setval(x);
if(top == NULL)
settop(nn);
else
{
nn->setnext(gettop());
settop(nn);
if(gettop() == NULL)
cout<<"EMPTY";
return 0;
else
stack *t;
t = gettop();
settop(gettop()->getnext());
float z = t->getval();
t->setnext(NULL);
delete t;
return z;
}
}
void intopos::eva()
float e, f, u;
int w = 0, b;
while(w < j)
b = icp(post[w]);
if(b == -2)
cin>>e;
push1(e);
if(b == 1)
if(post[w] == '+')
e = pop1();
f = pop1();
u = e+f;
push1(u);
if(post[w] == '-')
e = pop1();
f = pop1();
u = (f-e);
push1(u);
else if(b == 2)
if(post[w] == '*')
e = pop1();
f = pop1();
u = (e*f);
push1(u);
if(post[w] == '/')
e = pop1();
f = pop1();
u = (f/e);
push1(u);
else if(b == 4)
e = pop1();
f = pop1();
u = pow(e,f);
push1(u);
w++;
float e, f, u;
char *h;
int w = 0, b, l;
cin>>w;
h = new char[20];
cin>>h[l];
l = 0;
while(l < w)
b = icp(h[l]);
if(b == -2)
cin>>e;
push1(e);
if(b == 1)
if(h[l] == '+')
e = pop1();
f = pop1();
u = e+f;
push1(u);
if(h[l] == '-')
e = pop1();
f = pop1();
u = (f-e);
push1(u);
else if(b == 2)
if(h[l] == '*')
e = pop1();
f = pop1();
u = (e*f);
push1(u);
if(h[l] == '/')
e = pop1();
f = pop1();
u = (f/e);
push1(u);
else if(b == 4)
e = pop1();
f = pop1();
u = pow(e,f);
push1(u);
l++;
int main()
int d; //choice
do{
cin>>d;
switch(d)
case 1:{
intopos i1;
i1.disp();
cin>>y;
break;
case 2:{
intopos i2;
break;
default:{
break;
}
cout<<"\nContinue(y/Y): ";
cin>>y;
return 0;
$$11th queue
#include<iostream>
public:
job()
next = NULL;
void setnum(int x)
num = x;
}
void setnext(job *y)
next = y;
int getnum()
return num;
job* getnext()
return next;
};
class order
job *first,*last,*temp1; //first is front of queue and last is rear of queue, temp1 is taken
for verification of data inside queue
public:
order()
first = NULL;
last = NULL;
temp1=NULL;
}
void create();
void add();
void del();
void display();
};
char ans;
do
int n;
cin>>n;
job *nn;
nn = new job();
nn->setnum(n);
if(first == NULL)
first = nn;
last = nn;
else
{
last->setnext(nn);
last=last->getnext();
cout<<"\njob inserted";
cin>>ans;
int n;
job *nn;
nn = new job();
cin>>n;
nn->setnum(n);
if(first == NULL)
first = nn;
last = nn;
else
{
last->setnext(nn);
last=last->getnext();
if(first == NULL)
else
job *temp;
temp = first->getnext();
delete(first);
first = temp;
temp1 = first;
cout<<temp1->getnum()<<" ";
while(temp1->getnext()!= NULL)
temp1 = temp1->getnext();
cout<<temp1->getnum()<<" ";
cout<<endl;
char ans;
order l;
do
int choice;
cin>>choice;
cout<<endl;
switch(choice)
case 1:
l.create();
break;
case 2:
l.add();
break;
case 3:
l.del();
break;
case 4:
l.display();
break;
default:
break;
cin>>ans;
cout<<endl;
#include<iostream>
#define SIZE 10
class dqueue
int queue1[SIZE];
int front,rear;
public:
dqueue()
front=-1;
rear=-1;
int deQueueFront();
int deQueueRear();
void enQueueRear();
void enQueueFront();
void display_front();
void display_rear();
};
void dqueue::enQueueRear()
int value;
if(rear==SIZE-1)
return;
else
if(front==-1)
front=0;
cin>>value;
rear=rear+1;
queue1[rear] = value;
}
else
cin>>value;
rear=rear+1;
queue1[rear] = value;
void dqueue::enQueueFront()
int value;
if(front==0)
return;
else
cin>>value;
if(front==-1)//first element
front=rear=0;
else
front--;
queue1[front] = value;
int dqueue::deQueueRear()
int deleted_element;
// deleted = queue1[rear];
if(front == -1)
return 0;
front=rear=-1;
}
else if(rear==0)
deleted_element = queue1[rear] ;
rear=rear-1;
else
deleted_element = queue1[rear];
rear=rear-1;
return deleted_element;
int dqueue::deQueueFront()
int deleted_element;
// deleted_element = queue1[front];
if(front == -1)
return 0;
deleted_element = queue1[front];
front=rear=-1;
else
deleted_element = queue1[front];
front=front+1;
return deleted_element ;
void dqueue::display_front()
int i;
if(front == -1)
else
cout<<queue1[front]<<"\t";
}
}
void dqueue::display_rear()
int i;
if(front == -1)
else{
cout<<queue1[rear]<<"\t";
int main()
{ dqueue DQ;
char ch;
do
cout<<"5.Display_front \n";
cout<<"6.Display_rear \n";
cout<<"\nEnter your choice : ";
cin>>choice1;
switch(choice1)
case 1: DQ.enQueueRear();
break;
break;
case 3: value=DQ.deQueueFront();
break;
case 4: DQ.enQueueFront() ;
break;
case 5: DQ.display_front();
break;
case 6: DQ.display_rear();
break;
cin>>ch;
}while(ch=='y'||ch=='Y');
return 0;
#include<iostream>
class queue
int front,rear,a;
int arrq[20];
public:
queue()
a=0;
front=-1;
rear=0;
void add();
void deliver_order();
int qempty();
int qfull();
void display_first();
void display_last();
};
if(rear==a-2)
return 1;
else
return 0;
if(front==rear)
return 1;
else
return 0;
if(a==0)
cin>>a;
int order,ans,order_no,count;
count=1;
do
if(qfull()==1)
break;
else
cin>>order;
if(front==-1)
front=0;
count=1;
arrq[rear]=order;
else
arrq[rear]=order;
rear=(rear+1)%a;
}
count++;
cin>>ans;
while(ans==1);
if(qempty()==1)
else
int x=arrq[front];
if(front==rear)
front=rear=-1;
else
front=(front+1)%a;
if(qempty()==1)
else
if(qempty()==1)
else
int main()
queue q;
int ch;
char ans;
do
{
cout<<"WELCOME TO PIZZA PARLOR \n1.Place Your Order.\n2.Display First
Order\n3.Display Last Order.\n4.Deliver Order.\n";
cin>>ch;
switch(ch)
case 1 :q.add();
break;
case 2 :q.display_first();
break;
case 3 :q.display_last();
break;
case 4 :q.deliver_order();
break;
cin>>ans;
while(ans=='y'||ans=='Y');
return 0;