What are some types of Queue?

Technology CommunityCategory: Data StructuresWhat are some types of Queue?
VietMX Staff asked 3 years ago

Queue can be classified into following types:

  • Simple Queue – is a linear data structure in which removal of elements is done in the same order they were inserted i.e., the element will be removed first which is inserted first.

type-of-queue-1

 

  • Circular Queue – is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle and the last position is connected back to the first position to make a circle. It is also called Ring Buffer. Circular queue avoids the wastage of space in a regular queue implementation using arrays.

ring-buffer

 

  • Priority Queue – is a type of queue where each element has a priority value and the deletion of the elements is depended upon the priority value

priority-quue-3

 

  • In case of max-priority queue, the element will be deleted first which has the largest priority value
  • In case of min-priority queue the element will be deleted first which has the minimum priority value.
  • De-queue (Double ended queue) – allows insertion and deletion from both the ends i.e. elements can be added or removed from rear as well as front end.

de-queue

 

  • Input restricted deque – In input restricted double ended queue, the insertion operation is performed at only one end and deletion operation is performed at both the ends.

input-restricted-dequeue

 

  • Output restricted deque – In output restricted double ended queue, the deletion operation is performed at only one end and insertion operation is performed at both the ends.

 

output-restricted-queue