Program To Insert, Delete, Display Data in Circular Queue
Program To Insert, Delete, Display Data in Circular Queue
Program To Insert, Delete, Display Data in Circular Queue
.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int item,res,ch;
do
{
cout<<"\t\t\tCIRCULAAR QUEUE MENU \n";
cout<<"\t1.INSERT \n";
cout<<"\t2.DELETE \n";
cout<<"\t3.DISPLAY \n";
cout<<"\t4.EXIT \n";
cout<<"ENTER CHOICE(1-4) : ";
cin>>ch;
switch(ch)
{
case 1:clrscr();
cout<<"ENTER ITEM FOR INSERTION :";
cin>>item;
res=insertion(cqueue,item);
if(res==-1)
cout<<"OVERFLOW!!\n";
else
{
cout<<"NOW CIRCULAR QUEUE IS :";
display(cqueue,front,rear);
}
break;
case 2:clrscr();
item=deletion(cqueue);
cout<<"ELEMENT DELETED IS :"<<item<<endl;
display(cqueue,front,rear);
break;
case 3:clrscr();
display(cqueue,front,rear);
break;
case 4:break;
default:cout<<"INVALID CHOICE!!";
break;
}
}
while(ch!=4);
getch();
}