Insertion in circular Queue by R4R Team

Following is the function that are used to insert the element in circular queue

int insert()
{
int item;
if(front==0 && rear==MAX-1) || (front==rear+1)
{
printf("Queue is overflow\n");
return 0;
}
if(front==-1)
{
front=0;
rear=0;
}
else
{
if(rear==MAX-1)
rear=0;
else
rear=rear+1
}
printf("Enter the element for insertion\n");
scanf("%d",&item);
circular_queue[rear]=item;
}




Leave a Comment:
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!