Queue implementation in C
Queue is another linear data structures . Have you stand in a queue. People who stands in the front will go first. Same principle is applicable here. This principle is called FIFO(First In First Out). Functions and variables in queue: First element denotes front. Last element represents rear. To insert an element in rear end use enqueue (). To delete an element, consider dequeue() function. ‘peek()’ is a function which makes the user to view the front element. It doesn’t delete the element. Let us create a queue using arrays in C . Program: #include < stdio.h > #include < stdlib.h > #define MAX 9 // Let us declare the maximum size of queue int queue[MAX]; int front = -1, rear = -1; // queue is full or not int isFull() { return (rear == MAX - 1); } // Queue empty checking int isEmpty() { return (fr...