IMPLEMENTATION OF QUEUE BY LINKEDLIST : C PROGRAM
Hey there ,welcome to yocoding. Here is the code for queue by linked list in C programming language. Program code : #include<stdio.h> #include <stdlib.h> struct node { int data; struct node *next; }; struct node *rear=NULL,*front=NULL; void enque(int d) { struct node *p; p=(struct node *)malloc(sizeof(struct node)); p->data=d; if(front==NULL) { p->next=NULL; front=p; rear=p; return; } rear->next=p; p->next=NULL; rear=p; return; } void deque() { struct node *temp; if(front==NULL) printf("queue is empty.\n"); else if(front==rear){ printf("deleted element %d.\n",front->data); ...