Queue using Linked List
Queue using linked list /*******************************************************************************/ #include<stdio.h> #include<conio.h> #include <stdlib.h> struct Node { int data; struct Node *next; }*front=NULL,*rear=NULL; void enqueue() { struct Node *newnode=(struct Node*)malloc(sizeof(struct Node)); printf("Enter data:"); scanf("%d",&newnode->data); newnode->next=NULL; if(front==NULL) { front=newnode; rear=newnode; } else { rear->next=newnode; rear=newnode; } } int dequeue() { if (front==NULL) {printf("Queue is empty...underflow");return -1;} else { struct Node *temp; temp=front; int rv=front->data; front=front->next; if(front==NULL) rear=NULL; free(temp); ...