Queue Operations

 Queue Operations are......

         Enqueue—Add an item(new item in back side) to the end of the queue.

         Dequeue—Remove an item from the front.

         Queue Front—Who is first?

         Queueu End—Who is last?


Program to implement Circular Queue using Array

Circular queue may be viewed as the array that holds the queue elements in circular rather than as a straight line. That means we may imagine that the first element of the array immediately follows the last elements.

Program of queue using Linked List

As in Stacks, a queue could be implemented using a Linked List. A queue can be implemented by the following declarations and algorithms:

Program of queue using array

To represent(create) a queue we require a one dimensional array of some maximum size(int queue_arra[MAX];)  to hold the data items and two other variable (int rear = -1;int front = -1;) to point to the beginning and the end of the queue.