C program of circular queue using linked list

C program of circular queue using linked list : A circular queue is one in which the insertion of new element is done at the very first location of the queue if the last location of the queue is full. Suppose if we have a Queue of n elements then after adding the element at the last index i.e. (n-1)th , as queue is starting with 0 index, the next element will be inserted at the very first location of the queue which was not possible in the simple linear queue. That’s why linear queue leads to wastage of the memory, and this flaw of linear queue is overcome by circular queue.

So, in all we can say that the circular queue is a queue in which first element come right after the last element, that means a circular queue has a starting point but no end point.

While dealing with the circular queue we will use the following assumptions :

Front will always be pointing to the first element of the queue.

If Front=Rear, the queue will be empty.

Each time a new element is inserted into the queue, the value of rear is incremented by one i.e.
Rear = (Rear + 1);

Each time when an existing element is deleted from the queue, the value of rear is incremented by one i.e.
Front = (Front + 1);

Operations that can be performed on circular queue :

Like other data sturctures we can perform below operations on circular queues.

Well, I am software programmer and love to code. My hobbies is to do Hacking, Coding, Blogging, Web Designing and playing online games.
Feel free to contact me at shiviskingg@gmail.com or lokesh@hackingloops.com