In queue, the insertion takes place from the rear of the queue and the removal from the from the front of the queue.For Example,you may have seen a line of people to pay their bills on the billing counter.What happens there is that the person who is on the front of the line, pays his bill and leave that space.Whereas the people keep coming and stand in the line for their turn from the back of the line.This is the same pattern of the queue.
Insertion of element is known as Enqueue and removal is known Dequeue.
Here is a Queue program implemented through link list.
No comments:
Post a Comment