Array Implementation of Circular Queue
Array Implementation of Circular Queue
#include<iostream.H>
#include<string.H>
#include<stdio.H>
#include<conio.H>
const N=5;
class cqueue
{
float A[N];
int front;
int rear ;
public:
cqueue(){front=-1;rear=-1;}
void addcq();
void delcq();
void dispcq();
};
void main()
{
int choice;
cqueue cq;
do
{
cout<<"1.ADD\n";
cout<<"2.DELETE\n";
cout<<"3.DISPLAY \n";
cout<<"4.QUIT\n";
choice=getch();
switch(choice)
{
case '1': cq.addcq(); break;
case '2': cq.delcq(); break;
case '3': cq.dispcq(); break;
case '4': break;
default :cout<<"\nWrong Choice Entered !!\n\n";
}
}while(choice!='4');
}