Types of Queue in Data Structure
Types of Queue in Data Structure
A Queue is a FIFO (First In First Out) data structure where the element that is added
first will be deleted first. The basic queue
operations are enqueue (insertion) and dequeue (deletion). Enqueue is done at
the front of the queue and dequeue is done at the end of the queue. The elements
in a queue are arranged sequentially and hence queues are said to be linear data
structures.
Types of Queues in Data Structure
1. Simple Queue
2. Circular Queue
3. Priority Queue
4. Dequeue (Double Ended Queue)
Simple Queue
The simple queue is a normal queue where insertion takes place at the FRONT of
the queue and deletion takes place at the END of the queue.
Circular Queue
In a circular queue, the last node is connected to the first node.
Circular queue is also called as Ring Buffer.
Insertion in a circular queue happens at the FRONT and deletion at
the END of the queue.
Priority Queue
In a priority queue, the nodes will have some predefined priority.
Insertion in a priority queue is performed in the order of arrival of the nodes.
The node having the least priority will be the first to be removed from the
priority queue.
enqueue()
dequeue()