Circular Queue Implementation
In the normal Queue, we can insert the data till the Queue gets full. And rear will point to the last element. Therefore, no further addition of the elements can takes place. Even the elements get deleted, the further use of the free space can not be possible. To overcome the problem of normal Queue, a new data structure is introduced called Circular Queue. In Circular Queue, the last position of the queue is connected back to first position. This structure allows the data insertion and deletion in circular manner, and allow to further use the free space of the Queue. Graphical representation of circular Queue Implementation of Circular Queue using Linked List #include #include struct node { int data; struct node *next; }*front=NULL,*rear=NULL; void Enqueue() { int n; struct node *newNode=(struct node*)malloc(sizeof(struct node)); printf("Insert the data\n"); scanf("%d",&n); newNode->data=n; if(rear==NULL) { front=newNode; rear=newNode; newNo