Implementaion of Queue
Implementaion of Queue
#include<stdio.h>
#include<conio.h>
struct Node
int data;
};
void insert(int);
void delete();
void display();
void main()
clrscr();
while(1)
scanf("%d",&choice);
switch(choice)
scanf("%d", &data);
insert(data);
break;
case 2: delete();
break;
case 3: display();
break;
case 4: exit(0);
newNode->data = data;
if(front == NULL)
front = rear = newNode;
else
rear = newNode;
printf("\nInsertion is successfull..!!\n");
void delete()
if(front == NULL)
printf("\nQueue is Empty!!!\n");
else
free(temp);
void display()
if(front == NULL)
printf("\nQueue is Empty!!!\n");
else
while(temp->next != NULL)
printf("%d--->",temp->data);
printf("%d--->NULL\n",temp->data);
}
Output=