A queue like a stack is another special type of ordered list. In queue insertion operations are permitted at one end of the list and deletion operations are performed at the other end of the list. The end where insertion operations are performed is called rear and the end where deletion operations are performed is called front. A queue is often called Fisrt In Fisrt Out(FIFO) list because the first element removed is the first element added to the queue.

Here we will see the operations on stack using linked list because the stack is never full as long as the system has enough space for dynamic memory allocation.

A queue can defined by following structure:

If queue variable is q then q->front points to the front extreme end and q->rear points to the rear extreme end of the queue.

The complete source code is given below

The output

Thanks for reading.

Software Professional, I am passionate to work on web/enterprise application. For more information please go to about me. You can follow on Twitter. You can be a friend on Facebook or Google Plus or Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.