A Queue is a linear structure which follows a particular order in which the operations are performed. The order is First In First Out (FIFO).
Queue is also an abstract data type or a linear data structure, just like stack data structure, in which the first element is inserted from one end called the REAR(also called tail), and the removal of existing element takes place from the other end called as FRONT(also called head).
Structure of Queue:
Basically, Queue have two side i.e., front and rear
front: In which deletion is possible
rear : Insertion is done in this point
How Stack Implement in C ?
There are two ways by which we can implement the stack, i.e.,
We use Array data Structure To implement the Queue.
We use Linklist To implement all operation on Queue
Basic Task Perform on Queue :
enqueue() : Insertion in Queue(at rear)
dequeue() : Deletion in Queue(at front)
isEmpty() : Check Queue is Empty or Not.
Type of Queue:
There are generally three types of queue is possible
- Deques(Doubly ended Queue)
- Circular Queue
- Priority Queue
Application of Queue:
-Cashier on hold for Tech support
-people on an escalator
-checkout at any book store